Code preference:
Curl
Ruby
Php
Python
Node.js
C#
Java

SMS API

Developers can send a transactional SMS as well as manage their SMS campaign using this API. Following are the various operations supported by this API.

This API call will let you send a transactional SMS.

Input Parameter Description
to The mobile number to send SMS to with country code [Mandatory].
from The name of the sender. The number of characters is limited to 11 ( alphanumeric format ) [Mandatory].
text The text of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Mandatory].
web_url The web URL that can be called once the message is successfully delivered [Optional].
In web_url, we are sending the content using POST method, example: {“status”:”OK”,”number_sent”:1,”to”:”00331234567890″,”sms_count”:1,”credits_used”:1,”remaining_credit”:55,”reference”:{“1″:”a1bcdefghij0klmnopq”}}
tag The tag that you can associate with the message [Optional].
type Type of message. Possible values – marketing (default) & transactional [Optional].
It is recommended to use ‘transactional’ type for sending transactional SMS and ‘marketing’ type for sending marketing SMS.

Example :

Sample Output :

Below are few examples of the callback content for all events:

Description Response
When SMS is requested: {“status”:”OK”,”number_sent”:1,”to”:”0033663309701″,”sms_count”: 3,”credits_used”: 13.5,”remaining_credit”:95.5,”reference”:{“1″:”4dhx5xvk08lluh3n7d”}}
When SMS is accepted by provider: {“status”:”OK”,”to”:”0033663309701″,”reference”:{“1″:”4dhx5xvk08lluh3n7d”},”description”:”accepted”}
When SMS is delivered by provider: {“status”:”OK”,”to”:”0033663309701″,”reference”:{“1″:”4dhx5xvk08lluh3n7d”},”description”:”delivered”}
When user reply to the SMS: {“status”:”OK”,”to”:”0033663309701″,”reference”:{“1″:”4dhx5xvk08lluh3n7d”},”description”:”replied”,”reply”:”reply content”}
When user unsubscribe: {“status”:”OK”,”to”:”0033663309701″,”reference”:{“1″:”4dhx5xvk08lluh3n7d”},”description”:”unsubscribed”}
When SMS is hard bounced: {“status”:”OK”,”to”:”0033663447831″,”reference”:{“1″:”4dhdfywypd4yqfcsjh”},”bounce_type”:”hard_bounce”,”error_code”:23,”description”:”Message is undeliverable due to an incorrect / invalid / blacklisted / permanently barred MSISDN for this operator”}
( Error code and description values can have other possible values. )
When SMS is soft bounced: {“status”:”OK”,”to”:”0033663447851″,”reference”:{“1″:”4ecbgtbyjbnrgbrtqskj”},”bounce_type”:”soft_bounce”,”error_code”:5,”description”:”We have no info about failure”}
( Error code and description values can have other possible values. )
When SMS is blocked (already declared as hard bounce or unsubscribed): {“status”:”KO”,”description”:”Telephone number blocked.”}
This API call will let you create & schedule your SMS campaigns.

Input Parameter Description
camp_name Name of the SMS campaign [Mandatory].
sender This allows you to customize the SMS sender. The number of characters is limited to 11 ( alphanumeric format ) [Optional].
content Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Optional].
bat_sent Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Optional].
listids These are the list ids to which the SMS campaign is sent [Mandatory: if scheduled_date is not empty].
exclude_list These are the list ids which will be excluded from the SMS campaign [Optional].
scheduled_date The day on which the SMS campaign is supposed to run [Optional].
send_now Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional].

Example :

Sample Output :

If successful, it returns the ID of the created SMS campaign.

This API call will let you update & schedule your SMS campaigns. You can only update a campaign before the scheduled date.

Input Parameter Description
id Id of the SMS campaign [Mandatory].
camp_name Name of the SMS campaign [Optional].
sender This allows you to customize the SMS sender. The number of characters is limited to 11 ( alphanumeric format ) [Optional].
content Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Optional].
bat_sent Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Optional].
listids These are the list ids to which the SMS campaign is sent [Mandatory: if scheduled_date is not empty].
exclude_list These are the list ids which will be excluded from the SMS campaign [Optional].
scheduled_date The day on which the SMS campaign is supposed to run [Optional].
send_now Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional].

Example :

Sample Output :

This API call will let you send a test SMS.

Input Parameter Description
campid Id of the SMS campaign [Mandatory].
mobilephone Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Mandatory].

Example :

Sample Output :