Skip to content
Create an account

Send a message

Send a message #

Once your instance is paired and connected, you can send text, media and location messages through the API.

Text message

POST /v1/whatsapp/{instanceCode}/send/text

Body parameters

Parameter Type Required Description
tostringYesRecipient number in E.164 format (e.g. +22507XXXXXXXX).
messagestringYesThe text to send (4096 characters at most).
scheduled_atdatetimeNoSend later, at this date and time (YYYY-MM-DD HH:MM:SS).
skip_duplicatedbooleanNoIf true and an identical message was already sent to this number in the last 24 hours, nothing is sent: the response describes that message, with skipped set to true.
// Envoyer un message texte WhatsApp
const credentials = btoa('ACCESS_KEY:ACCESS_SECRET');
const res = await fetch('https://api.callistosignal.com/v1/whatsapp/{instanceCode}/send/text', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Basic ' + credentials
    },
    body: JSON.stringify({
        to: '+22507XXXXXXXX',
        message: 'Bonjour Aïcha'
    })
});
// Envoyer un message texte WhatsApp
$ch = curl_init('https://api.callistosignal.com/v1/whatsapp/{instanceCode}/send/text');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_USERPWD        => 'ACCESS_KEY:ACCESS_SECRET',
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'to'      => '+22507XXXXXXXX',
        'message' => 'Bonjour Aïcha',
    ]),
]);
$response = curl_exec($ch);
curl -u 'ACCESS_KEY:ACCESS_SECRET' \
  -X POST https://api.callistosignal.com/v1/whatsapp/{instanceCode}/send/text \
  -H 'Content-Type: application/json' \
  -d '{"to":"+22507XXXXXXXX","message":"Bonjour Aïcha"}'

Response (200)

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "instance_id": "550e8400-e29b-41d4-a716-446655440001",
  "recipient": "+22507XXXXXXXX",
  "message_type": "text",
  "status": "queued",
  "scheduled": false,
  "skipped": false
}

status is queued, or pending when the send is scheduled with scheduled_at.

Media message

POST /v1/whatsapp/{instanceCode}/send/media

Body parameters

Parameter Type Required Description
tostringYesRecipient number (E.164).
typestringYesimage, video, document or audio.
media_urlstringYesPublic URL of the file (http:// or https://).
captionstringNoCaption shown with the media (max 1024 characters).
filenamestringNoFile name, useful for document (max 255 characters).
scheduled_atdatetimeNoSend later, at this date and time (YYYY-MM-DD HH:MM:SS).
skip_duplicatedbooleanNoIf true and an identical message was already sent to this number in the last 24 hours, nothing is sent: the response describes that message, with skipped set to true.
// Envoyer un média WhatsApp
const credentials = btoa('ACCESS_KEY:ACCESS_SECRET');
const res = await fetch('https://api.callistosignal.com/v1/whatsapp/{instanceCode}/send/media', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Basic ' + credentials
    },
    body: JSON.stringify({
        to: '+22507XXXXXXXX',
        type: 'image',
        media_url: 'https://example.com/photo.jpg',
        caption: 'Notre nouveau produit'
    })
});
// Envoyer un média WhatsApp
$ch = curl_init('https://api.callistosignal.com/v1/whatsapp/{instanceCode}/send/media');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_USERPWD        => 'ACCESS_KEY:ACCESS_SECRET',
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'to'        => '+22507XXXXXXXX',
        'type'      => 'image',
        'media_url' => 'https://example.com/photo.jpg',
        'caption'   => 'Notre nouveau produit',
    ]),
]);
$response = curl_exec($ch);
curl -u 'ACCESS_KEY:ACCESS_SECRET' \
  -X POST https://api.callistosignal.com/v1/whatsapp/{instanceCode}/send/media \
  -H 'Content-Type: application/json' \
  -d '{"to":"+22507XXXXXXXX","type":"image","media_url":"https://example.com/photo.jpg","caption":"Notre nouveau produit"}'

Response (200)

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "instance_id": "550e8400-e29b-41d4-a716-446655440001",
  "recipient": "+22507XXXXXXXX",
  "message_type": "image",
  "media_url": "https://example.com/photo.jpg",
  "status": "queued",
  "scheduled": false,
  "skipped": false
}

Location message

POST /v1/whatsapp/{instanceCode}/send/location

Body parameters

Parameter Type Required Description
tostringYesRecipient number (E.164).
latitudenumberYesLatitude between -90 and 90.
longitudenumberYesLongitude between -180 and 180.
namestringNoName of the place (≤ 255 characters).
addressstringNoPostal address (≤ 1024 characters).
scheduled_atdatetimeNoSend later, at this date and time (YYYY-MM-DD HH:MM:SS).
skip_duplicatedbooleanNoIf true and an identical message was already sent to this number in the last 24 hours, nothing is sent: the response describes that message, with skipped set to true.
// Envoyer une localisation WhatsApp
const credentials = btoa('ACCESS_KEY:ACCESS_SECRET');
const res = await fetch('https://api.callistosignal.com/v1/whatsapp/{instanceCode}/send/location', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Basic ' + credentials
    },
    body: JSON.stringify({
        to: '+22507XXXXXXXX',
        latitude: 5.3599517,
        longitude: -4.0082563,
        name: 'Plateau, Abidjan',
        address: 'Boulevard de la République, Abidjan'
    })
});
// Envoyer une localisation WhatsApp
$ch = curl_init('https://api.callistosignal.com/v1/whatsapp/{instanceCode}/send/location');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_USERPWD        => 'ACCESS_KEY:ACCESS_SECRET',
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'to'        => '+22507XXXXXXXX',
        'latitude'  => 5.3599517,
        'longitude' => -4.0082563,
        'name'      => 'Plateau, Abidjan',
        'address'   => 'Boulevard de la République, Abidjan',
    ]),
]);
$response = curl_exec($ch);
curl -u 'ACCESS_KEY:ACCESS_SECRET' \
  -X POST https://api.callistosignal.com/v1/whatsapp/{instanceCode}/send/location \
  -H 'Content-Type: application/json' \
  -d '{"to":"+22507XXXXXXXX","latitude":5.3599517,"longitude":-4.0082563,"name":"Plateau, Abidjan"}'

Response (200)

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "instance_id": "550e8400-e29b-41d4-a716-446655440001",
  "recipient": "+22507XXXXXXXX",
  "message_type": "location",
  "status": "queued",
  "scheduled": false,
  "skipped": false
}