Skip to content
Home » Octopush Gateway SMS API » Voice SMS API » Send Voice SMS

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’]. Here is availability of gender for each available country (F for female, M for male : ‘pl-PL’ => [F, M], ‘sv-SE’ => [F], ‘de-DE’ => [F, M], ‘en-GB’ => [F, M], ‘en-US’ => [F, M], ‘es-ES’ => [F, M], ‘fr-FR’ => [F, M], ‘it-IT’ => [F, M], ‘pt-BR’ => [F, M], ‘ru-RU’ => [F, M], ‘arb’ => [F], ‘ca-ES’ => [F], ‘zh-HK’ => [F, M], ‘mn-CN’ => [F], ‘da-DK’ => [F, M], ‘nl-NL’ => [F, M], ‘en-AU’ => [F, M], ‘en-IN’ => [F], ‘en-NZ’ => [F], ‘en-ZA’ => [F], ‘il-PH’ => [F, M], ‘fr-CA’ => [F, M], ‘de-AT’ => [F], ‘hi-IN’ => [F], ‘is-IS’ => [F, M], ‘id-ID’ => [F, M], ‘ja-JP’ => [F, M], ‘ko-KR’ => [F], ‘ms-MY’ => [F, M], ‘nb-NO’ => [F], ‘pt-PT’ => [F, M], ‘ro-RO’ => [F], ‘es-MX’ => [F], ‘es-US’ => [F, M], ‘th-TH’ => [F, M], ‘tr-TR’ => [F], ‘uz-UZ’ => [F, M], ‘vi-VN’ => [F, M], ‘cy-GB’ => [F])
voice_languagestringVoice Language. Available values: [‘en-US’, ‘en-GB’, ‘pl-PL’, ‘sv-SE’, ‘de-DE’, ‘es-ES’, ‘fr-FR’, ‘it-IT’, ‘pt-BR’, ‘ru-RU’, ‘arb’, ‘ca-ES’, ‘zh-HK’, ‘mn-CN’, ‘da-DK’, ‘nl-NL’, ‘en-AU’, ‘en-IN’, ‘en-NZ’, ‘en-ZA’, ‘il-PH’, ‘fr-CA’, ‘de-AT’, ‘hi-IN’, ‘is-IS’, ‘id-ID’, ‘ja-JP’, ‘ko-KR’, ‘ms-MY’, ‘nb-NO’, ‘pt-PT’, ‘ro-RO’, ‘es-MX’, ‘es-US’, ‘th-TH’, ‘tr-TR’, ‘uz-UZ’, ‘vi-VN’, ‘cy-GB’]
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_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.
get_back_pressed_keysboolean(optionnel) If this field has the value “true”, your voice call will let your recipient press some keys from his phone keyboard. After 2 seconds, the call will end (6 keys max).

Curl Example

curl -X POST \ 
'https://api.octopush.com/v1/public/voice-campaign/send' \ 
-H 'Content-Type: application/json' \ 
-H 'api-login: *****@email.org' \ 
-H 'api-key: ******' \ 
-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"
 }'

Command to copy/paste

curl -X POST 'https://api.octopush.com/v1/public/voice-campaign/send' -H 'Content-Type: application/json' -H 'api-login: *****@email.org' -H 'api-key: ******' -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."
      }
   }
}