Send SMS
Send SMS With Token
Endpoint: POST /api/sms-with-token/
Description: Send SMS using a specific API token. This API token can be generated from API Token Generation. Please refer to Getting started for further details on how to generate API tokens.
Headers:
{
"Authorization": "Token <YOUR_AUTH_KEY>",
"Content-Type": "application/json"
}
Request Payload:
| Field | Required | Description |
|---|---|---|
| token | Yes |
|
| phone_number | Yes |
|
| message | Yes |
|
| sender_id | No |
|
Request Body:
{
"token": "Enter your API Token here",
"phone_number": ["+9779813012345", "9813012345", "+9779841012345", "9841012345", "0000001787"],
"message": "Your SMS content",
"sender_id": ""
}
Response:
{
"status": "Queued",
"message": "SMS Queued for delivery",
"batch_id": "1762243228024",
"ntc_phone_numbers": [
"9841012345",
"+9779841012345"
],
"ncell_phone_numbers": [
"+9779813012345",
"9813012345"
],
"invalid_phone_numbers": [
"0000001787"
],
"content": "Your SMS content"
}
Status Codes:
200 OK: SMS sent successfully400 Bad Request: Invalid request data401 Unauthorized: Invalid or missing auth token500 Internal Server Error: Server Encountered an Error
Common Error Responses
1. API token is not UUID
Status Code: 400 Bad Request
{
"error": "Invalid token format. Please provide a valid UUID.",
}
2. API token does not exist
Status Code: 400 Bad Request
{
"error": "Invalid token provided.",
}
3. Incase of insufficient credits
Status Code: 402 Payment Required
{
"message": "Insufficient credit",
}