Skip to content

Send Chat Message ​

This API allows you to send chat messages using the Cellcast API.

Parameters for Send Chat Message API ​

Headers Parameters ​

ParametersDescription
AuthorizationPlease add provided Bearer token - linked to your Cellcast account. Check here

Request Body Parameters ​

NameExampleDescription
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.
number["+61400000001", "+61400000002", "+61400000003"]JSON encoded Array - Required field. For multiple SMS send: ["+61400000001", "+61400000002", "+61400000003"]. You can pass 1000 numbers to send an SMS in one API call.
smsTemplateIdSMS Template IdPlease add SMS template ID
rmsTemplateIdRMS Template IdPlease add RMS template ID
countryCode#countrycode#Please add country code e.g. 61

Code Samples ​

Post https://api.cellcast.com/api/v1/chat

bash
curl --location 'https://api.cellcast.com/api/v1/chat' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{API_KEY}}' \
--data '{
  "sender": "YourSenderID",
  "number": [
    "+61400000000",
    "+61400000001"
  ],
  "countryCode": "61",
  "message": "Your chat message content",
  "smsTemplateId": "YourSMSTemplateID",
  "rmsTemplateId": "YourRMSTemplateID"
}'
js
const axios = require("axios");

const sendChatMessage = async () => {
  try {
    const response = await axios.post(
      "https://api.cellcast.com/api/v1/chat",
      {
        sender: "YourSenderID",
        number: ["+61400000000", "+61400000001"],
        countryCode: "61",
        message: "Your chat message content",
        smsTemplateId: "YourSMSTemplateID",
        rmsTemplateId: "YourRMSTemplateID",
      },
      {
        headers: {
          "Content-Type": "application/json",
          Accept: "application/json",
          Authorization: "Bearer {{API_KEY}}",
        },
      }
    );
    console.log(response.data);
  } catch (error) {
    console.error(error.response.data);
  }
};

Replace , YourSenderID, YourSMSTemplateID, and YourRMSTemplateID with the actual values according to your use case.

Responses ​

200 OK

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": "Chat message(s) sent successfully",
      "message_type": "toast",
      "error": {},
      "data": [
        {
          "number": "61400000000",
          "message": "Your chat message content",
        },
        {
          "number": "61400000000",
          "message": "Your chat message content",
        },
      ],
    },