Send Personalized SMS (Publipostage)

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

Definition

This option allows you to personalise your SMS for each of your recipients.
You can do this personalisation on your own, but this requires you to send us as many requests as there are phone numbers, which can take several minutes depending on the size of your lists.
Thanks to Octopush publipostage mailing option, your mailing will only take a few seconds for all your contacts.

Dynamic fields:

  • {first_name} : String, [50 chars max]
  • {last_name} : String, [50 chars max]
  • {param1} : String, [50 chars max]
  • {param2} : String, [50 chars max]
  • {param3} : String, [50 chars max]
  • {param4} : String, [50 chars max]
  • {param5} : String, [50 chars max]

Encoding: UTF-8

Special parameters

NameTypeDescription
textstringMessage text (from 1 to 1224 characters).
recipientsarrayList of Contact objects array of objects:
[
  {
    "phone_number": "+111222233334444",
    "first_name": "Alex",
    "last_name": "Smith",
    "param1": "M",
    "param2": null,
    "param3": null,
    "param4": null,
    "param5": null,
  },
  ...,
  {
    "phone_number": "+2222333334444555",
    "param1": "John",
  }
]
typestringCampaign Type: [“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”).’

* These parameters are optional. They may also contain only one data item.

Curl example

curl -X POST \ 
'https://api.octopush.com/v1/public/sms-campaign/send' \ 
-H 'Content-Type: application/json' \ 
-H 'api-key: ************' \ 
-H 'api-login: ******@email.org' \ 
-H 'cache-control: no-cache' \ 
-d '{
  "recipients": [
    {
      "phone_number": "+336000123",
      "first_name": "Alexandra",
      "last_name": "Robinson",
      "param1": "Mrs",
      "param2": "Dr Collins",
      "param3": "3:30 pm"
    },
    {
      "phone_number": "+336001234",
      "first_name": "Paul",
      "last_name": "McDonald",
      "param1": "Mr",
      "param2": "Dr Howard",
      "param3": "4:00 pm"
    }
  ],
  "text": "Hello {param1} {first_name} {last_name}, don'\''t forget your appointment with {param2} at {param3}. STOP au 30101",
  "type": "sms_premium",
  "purpose": "alert",
  "sender": "Medic"
}'

JSon Return

Success : 201 CREATED

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

Error : 400 Bad Request

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