Messaging

Messaging

The SMS API supports the following:

HTTP Methods

POST - To send an SMS message using the messaging subresource, you need to make a POST request and include the end user’s phone number along with the desired message.

Please ensure that the country code is included in the to parameter when sending messages globally. It is a mandatory requirement.

Before you begin sending SMS messages through this API, we recommend testing your content against pre-approved templates. This step is crucial to prevent any rejection of your SMS messages.

API Endpoint

https://eu.cpaas.bics.com/api/v2/

Note: Few elements in the endpoint may change from service to service.

POST

{endpoint}sms/send

MANDATORY PARAMETERS

Name Descriptions
to Phone number to send with country prefix.
message The content of the SMS
sender The registered and approved Sender-id
service The short code of the service name. ex: (MKT) full list

OPTIONAL PARAMETERS

Name Descriptions
webhook_id The id of the webhook created in Webhook Section for which the SMS response to be sent after delivery report from operator. read more. Instead of passing webhook_id everytime in the payload, refer to create subscription
time Schedule time (in format i.e,yyyy-mm-dd hh:mm:ss) at which the SMS has to be sent.
type The SMS to be sent is Unicode, Normal or Auto detect. (value “U”, “N” or “A”)
flash This parameter can be used to send flash sms via API ( Values 1 or 0.)
custom Your own unique_id
port Port number to which SMS has to be delivered
entity_id Principal Entityid registered in DLT portal (applicable for indian routes only)
template_id TemplateId registered in DLT portal (applicable for indian routes only)
max_units The maximum number of units to be sent in the message ex:(value 2 or 3)

Example Request

cURL - cURL
curl --location --globoff '{endpoint}api/v2/sms/send' \
--header 'Accept: application/json' \
--data '{
     "sender":"{sender_name}",
     "to":"{reciver}",
     "service":"MKT",
     "message":"Your OTP is 123456"
}'

Example Response

{
  "status": 200,
  "message": "1 numbers accepted for delivery.",
  "data": [
    {
      "id": "b34e35ad-fe34-4a8b-977c-b21cd76cd7d6:1",
      "mobile": "918921269xxx",
      "status": "AWAITING-DLR",
      "units": 1,
      "length": 7,
      "charges": 1,
      "customid": "",
      "iso_code": null,
      "submitted_at": "2018-07-09 16:27:35"
    }
  ]
}