Skip to content
Home » Octopush Gateway SMS API » Schedule SMS Sending

Schedule SMS Sending

POST
https://api.octopush.com/v1/public/sms-campaign/send

Encoding : UTF-8

Authentication

Your “api-key” and “api-login” must be added in the headers.

Definition

This is the same service as sending a simple SMS, but you can specify a sending date, in ISO format.
As soon as the date you have specified has passed, we will send your SMS.

Special parameters

NameTypeDescription
textstringMessage text (from 1 to 1224 characters).
recipientsarrayList of Contact objects array of objects:
[
  {
    "phone_number": "+111222233334444",
    "param1": "Alex"
  },
  ...,
  {
    "phone_number": "+2222333334444555",
    "param1": "John",
  }
]
typestringType of the campaign: [“sms_premium”,”sms_low_cost”]
senderstringSender of the message (if the user allows it), 3-11 alphanumeric characters (a-zA-Z0-9).
send_atstring‘When you want to send the sms campaign. Format: DateTime ISO8601 (for ex: “2018-10-03T07:42:39-07:00”).’
purposestringCampaign purpose: (transactional/alert or marketing) : [“alert”,”wholesale”]
with_repliesboolean“True” for getting back recipient replies
simulation_modeboolean(optional) If this value is “true”, your request will be simulated, and you will receive a fake result. Only some minimal validations will be executed.
request_idstring(optional) To avoid sending same request multiple times, setup an request ID. In case the duplication will be detected, a validation error will be returned. A request_id will expire after 24 hours.
auto_optimize_textboolean(optional) By transmitting this field with “false” value, your text will not be optimized by Octopush robot (your message could contain unicode characters, or useless spaces that could increase the number of needed SMS for each contact).
auto_remove_blacklisted_numbersboolean(optional) By transmitting this field with “true” value, the blacklisted numbers will be automatically removed from your list of numbers. This service will add a charge of 0.01€ per request.

Example Curl

curl -X POST \ 
'https://api.octopush.com/v1/public/sms-campaign/send' \ 
-H 'Content-Type: application/json' \ 
-H 'api-login: ******@email.org' \ 
-H 'api-key: ************' \ 
-H 'cache-control: no-cache' \ 
-d '{
  "recipients": [
    {
      "phone_number": "+ 442038828112",
      "param1": "Alex"
    }
  ],
  "text": "This is a Premium SMS with stop mention. STOP at XXXXX", 
  "type": "sms_premium",
  "purpose": "wholesale",
  "sender": "Company X",
  "send_at": "2025-07-29T11:00:39-07:00"
}'

Command to copy/paste

curl -X POST 'https://api.octopush.com/v1/public/sms-campaign/send' -H 'Content-Type: application/json' -H 'api-login: ******@email.org' -H 'api-key: ************' -H 'cache-control: no-cache' -d '{"recipients": [{"phone_number": "+ 442038828112", "param1": "Alex"}], "text": "This is a Premium SMS with stop mention. STOP at XXXXX", "type": "sms_premium", "purpose": "wholesale", "sender": "Company X", "send_at": "2025-07-29T11:00:39-07:00"}'

JSON Server Response

Success : 201 CREATED

{
  "sms_ticket": "sms_5f3fbce61266e",
  "number_of_contacts": 1,
  "total_cost": 5.00502839 
}

Failure : 400 Bad Request

{
  "code": 121,
  "message": "Mention STOP is missing."
}

For some ovh users, the use of curl_setopt($ch, CURLOPT_FRESH_CONNECT, true); in their Curl sending sequence may be useful.