Statuses
| Status | Meaning |
|---|---|
pending_verification | The number was created and is waiting for OTP confirmation |
active | The number is confirmed and can be used if the account is verified |
pending_account_verification | OTP is correct, but the Sinjapp account still needs account verification |
rejected | The number cannot be used for sending |
Create A Sender Number
Requiresmessages.send scope.
curl -X POST "https://{tenant}.sinjapp.org/api/v1/sender-numbers" \
-H "X-Api-Key: {tenant_api_key}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"phone": "{sender_phone}",
"display_name": "Support line"
}'
const response = await fetch('https://{tenant}.sinjapp.org/api/v1/sender-numbers', {
method: 'POST',
headers: {
'X-Api-Key': tenantApiKey,
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
phone: senderPhone,
display_name: 'Support line',
}),
})
const senderNumber = await response.json()
<?php
$response = file_get_contents('https://{tenant}.sinjapp.org/api/v1/sender-numbers', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => [
'X-Api-Key: ' . $tenantApiKey,
'Accept: application/json',
'Content-Type: application/json',
],
'content' => json_encode([
'phone' => $senderPhone,
'display_name' => 'Support line',
]),
'timeout' => 30,
],
]));
$senderNumber = json_decode($response, true);
import requests
response = requests.post(
"https://{tenant}.sinjapp.org/api/v1/sender-numbers",
headers={
"X-Api-Key": tenant_api_key,
"Accept": "application/json",
"Content-Type": "application/json",
},
json={
"phone": sender_phone,
"display_name": "Support line",
},
timeout=30,
)
sender_number = response.json()
List Sender Numbers
curl "https://{tenant}.sinjapp.org/api/v1/sender-numbers" \
-H "X-Api-Key: {tenant_api_key}" \
-H "Accept: application/json"
const response = await fetch('https://{tenant}.sinjapp.org/api/v1/sender-numbers', {
headers: {
'X-Api-Key': tenantApiKey,
'Accept': 'application/json',
},
})
const senderNumbers = await response.json()
<?php
$response = file_get_contents('https://{tenant}.sinjapp.org/api/v1/sender-numbers', false, stream_context_create([
'http' => [
'method' => 'GET',
'header' => [
'X-Api-Key: ' . $tenantApiKey,
'Accept: application/json',
],
'timeout' => 30,
],
]));
$senderNumbers = json_decode($response, true);
import requests
response = requests.get(
"https://{tenant}.sinjapp.org/api/v1/sender-numbers",
headers={
"X-Api-Key": tenant_api_key,
"Accept": "application/json",
},
timeout=30,
)
sender_numbers = response.json()