Skip to content

Quick Send SMS with Template ​

This API is to send SMS with Template messages.

Parameters for Send SMS with Template API ​

Headers Parameters ​

ParametersDescription
AuthorizationPlease add provided Bearer token - linked to your Cellcast account. Check here
Content-Typeapplication/json

Request Body Parameters ​

NameExampleDescription
templateId66bd9fb66b9668f9a3648355To use Message template Please provide templateId from get-template api
sender#SharedNum# or Sender ID (Custom ID)Sender ID (Custom ID): Valid characters: A-Z a-z 0-9, space, and Dash (-). A numeric sender ID can be a maximum length of 16 digits. An alpha-numeric Sender ID can be a maximum length of 11 characters. If 'from' is left blank, the system will default to 'Regular ID'. *Note: Price increases to 1.3 credits per SMS for Custom ID and dedicated numbers.
contacts["+61400000000"]JSON encoded Array - Required field. To send multiple SMS messages, provide the recipient numbers in a JSON-encoded array, such as ["+61400000000", "+61400000001"]. You can include up to 1,000 numbers in a single API call. Supported number formats include : "+61400000000", "61400000000", "0400000000", "400000000"
senderType['customNumber', 'businessName', 'dedicatedNumber', '#SharedNum#']'customNumber' - Your Own Number. 'businessName' - Alpha ID. 'dedicatedNumber' - For using Dedicated Number. '#SharedNum#' - Standard shared number is a set of local numbers.
scheduleAt2024-08-14T14:58:00.981ZLeave blank for immediate delivery. Your schedule time should be in Y-m-d H:i:s format UTC+0 Time
delay60000Leave blank for immediate delivery. Your delay time should be in miliseconds. Allowed max 86400000 miliseconds (24 Hours)

Code Samples ​

POST https://api.cellcast.com/api/v1/gateway

bash
curl --location 'https://api.cellcast.com/api/v1/gateway' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{API_KEY}}' \
--data '{
    "templateId": "66bd9fb66b9668f900000000",
    "contacts": [
        "+61400000000"
    ],
    "sender": "#SharedNum#",
    "senderType": "#SharedNum#",
    "delay": 10000
}'

Replace with the actual API key that you own.

Responses ​

Response Body ​

NameExampleDescription
messageId675161d8a000000000000000A unique identifier for the message, automatically generated by the system.

200 Success

json
{
    "app_type": "web",
    "app_version": "1.0",
    "maintainence": 0,
    "new_version": 0,
    "force_update": 0,
    "invalid_token": 0,
    "refresh_token": "",
    "show_message": 0,
    "is_enc": false,
    "status": true,
    "message": "Request is being processed",
    "message_type": "toast",
    "data": {
        "queueResponse": [
            {
                "Contact": "400000000",
                "MessageId": "66bed7906ada1a7d00000000",
                "Result": "Message added to queue."
            }
        ]
    },
    "error": {}
}

400 Bad Request

json
{
    "code": 400,
    "message": "Contacts must either start with 61 or +61 and be exactly 11 digits long (e.g., 614xxxxxxxx or +614xxxxxxxx), or be 9 digits without the area code (e.g., 4xxxxxxxx)",
    "stack": "APIError: Contacts are required."
}

422 Unprocessable Entity (Credit is too Low)

json
{
    "app_type": "web",
    "app_version": "1.0",
    "maintainence": 0,
    "new_version": 0,
    "force_update": 0,
    "invalid_token": 0,
    "refresh_token": "",
    "show_message": 0,
    "is_enc": false,
    "status": false,
    "message_type": "toast",
    "message": "Your balance is too low for this request, please recharge.",
    "data": {},
    "error": {
        "errorMessage": "Your balance is too low for this request, please recharge."
    }
}

401 Unauthorized

json
{
  "code": 401,
  "message": "Token expired",
  "stack": "APIError: Token expired ...."
}