Send Voice SMS

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

Encodage : UTF-8

Authentification

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

Definition

This sends a Voice SMS in modes:

  • simple (1 contact)
  • campaign (up to 500 contacts)

You must indicate your phone numbers in the “recipients” parameter, which is an array containing objects of type “contact”.

Special parameters

NameTypeDescription
textstringMessage text (from 1 to 1224 characters non unicode).
recipientsarrayList of Contact objects array of objects:
[
  {
    "phone_number": "+111222233334444"
  },
  ...,
  {
    "phone_number": "+2222333334444555"
  }
]
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”]
voice_genderstringVoice gender [‘male’, ‘female’]
voice_languagestringVoice Language [‘en-US’, ‘en-GB’, ‘el-GR’, ‘pl-PL’, ‘hu-HU’, ‘sv-SE’, ‘de-DE’, ‘es-ES’, ‘es-LA’, ‘fr-FR’, ‘it-IT’, ‘pt-BR’, ‘ru-RU’]
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.

Curl Example

curl -X POST \ 
'https://api.octopush.com/v1/public/voice-campaign/send' \ 
-H 'Content-Type: application/json' \ 
-H 'api-key: ******' \ 
-H 'api-login: *****@email.org' \ 
-H 'cache-control: no-cache' \ 
-d '{
  "recipients": 
  [
    {
      "phone_number": "+37379967255"
    }
  ],
  "text": "Here is a Voice SMS to listen to",
  "purpose": "alert",
  "sender": "12345",
  "voice_gender": "female",
  "voice_language": "en-GB"
 }'

JSON Server Response

Success : 201 CREATED

{
  "ticket_number": "voice_5f44ebf9e47b7",
  "number_of_contacts": 1,
  "total_cost": 0.05,
  "estimated_duration": 30,
  "residual_credit": 149.95
}

Failure : 400 Bad Request

{
   "code": 400,
   "message": "Payload validation error.",
   "errors":
   {
      "voice_language": 
      {
         "code": 442,
         "message": "Voice language not supported."
      }
   }
}