Skip to main content

Sending Messages

To ensure successful communication with the API, please include the following headers in all your requests:

  • Content-Type: application/json
  • Accept: application/json

The API responses will be returned in the following format:

{
"success": true,
"message": "Message sent successfully",
"data": { }
}
const token = 'YOUR_API_TOKEN';
const baseUrl = 'https://example.com/v2';
const url = `${baseUrl}/send-sms`;

const payload = {
sender_id: 1,
schedule:"none",
sms: "Hello World! I am sending my first SMS message using Notify Africa API",
recipients: [{ number: 2557654321 }, { number: 2557123456 }]
};

const response = await fetch(url, {
method: 'POST',
body: JSON.stringify(payload),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': `Bearer ${token}`
},
})

Request Parameters

The following parameters are required when sending an SMS message:

  • sender_id: The ID of the sender. This can be obtained from the sender ID list.
  • schedule: The schedule for sending the message. For instant messages, value is none.