{tenant} with your tenant subdomain and keep API keys on the server side.
Send A Text Message
curl -X POST "https://{tenant}.sinjapp.org/api/v1/messages" \
-H "X-Api-Key: {tenant_api_key}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"sender_phone": "{sender_phone}",
"to_phone": "{recipient_phone}",
"type": "text",
"content": "Hello from Sinjapp Business"
}'
const response = await fetch('https://{tenant}.sinjapp.org/api/v1/messages', {
method: 'POST',
headers: {
'X-Api-Key': tenantApiKey,
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
sender_phone: senderPhone,
to_phone: recipientPhone,
type: 'text',
content: 'Hello from Sinjapp Business',
}),
})
const message = await response.json()
<?php
$response = file_get_contents('https://{tenant}.sinjapp.org/api/v1/messages', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => [
'X-Api-Key: ' . $tenantApiKey,
'Accept: application/json',
'Content-Type: application/json',
],
'content' => json_encode([
'sender_phone' => $senderPhone,
'to_phone' => $recipientPhone,
'type' => 'text',
'content' => 'Hello from Sinjapp Business',
]),
'timeout' => 30,
],
]));
$message = json_decode($response, true);
import requests
response = requests.post(
"https://{tenant}.sinjapp.org/api/v1/messages",
headers={
"X-Api-Key": tenant_api_key,
"Accept": "application/json",
"Content-Type": "application/json",
},
json={
"sender_phone": sender_phone,
"to_phone": recipient_phone,
"type": "text",
"content": "Hello from Sinjapp Business",
},
timeout=30,
)
message = response.json()
Check Contact Reachability
curl "https://{tenant}.sinjapp.org/api/v1/contacts/lookup?phone={recipient_phone}&sender_phone={sender_phone}" \
-H "X-Api-Key: {tenant_api_key}" \
-H "Accept: application/json"
const params = new URLSearchParams({
phone: recipientPhone,
sender_phone: senderPhone,
})
const response = await fetch(`https://{tenant}.sinjapp.org/api/v1/contacts/lookup?${params}`, {
headers: {
'X-Api-Key': tenantApiKey,
'Accept': 'application/json',
},
})
const lookup = await response.json()
<?php
$query = http_build_query([
'phone' => $recipientPhone,
'sender_phone' => $senderPhone,
]);
$response = file_get_contents('https://{tenant}.sinjapp.org/api/v1/contacts/lookup?' . $query, false, stream_context_create([
'http' => [
'method' => 'GET',
'header' => [
'X-Api-Key: ' . $tenantApiKey,
'Accept: application/json',
],
'timeout' => 30,
],
]));
$lookup = json_decode($response, true);
import requests
response = requests.get(
"https://{tenant}.sinjapp.org/api/v1/contacts/lookup",
headers={
"X-Api-Key": tenant_api_key,
"Accept": "application/json",
},
params={
"phone": recipient_phone,
"sender_phone": sender_phone,
},
timeout=30,
)
lookup = response.json()