Voice Messaging

Everything about sending and viewing responses to voice messages

Languages
Servers
https://rest.clicksend.com/

Send Voice Message

Request

Send voice message(s)

Send TTS (Text-to-speech) voice calls

How many messages can I send?

You can post up to 1000 messages with each API call. You can send to a mix of contacts and contact lists, as long as the total number of recipients is up to 1000. The response contains a status and details for each recipient.

How many characters can I send in a message?

If a message is longer than 4 message parts, it will be truncated (see below). If a message contains any characters that aren't in the GSM 03.38 character set, the message type will be treated as unicode. (https://en.wikipedia.org/wiki/GSM_03.38)

Standard English Characters:

Number of CharactersMessage Credits
1 - 3001
301 - 6002
601 - 9003
901 - 12004

Non-GSM (Unicode) characters:

Number of CharactersMessage Credits
1 - 1501
151 - 3002
301 - 4503
451 - 6004

Allowed Languages

Language, Localelangvoice
English, USen-usfemale (default) / male
English, Australiaen-aufemale (default) / male
English, UKen-gbfemale (default) / male
English, Indiaen-infemale
English, Walesen-gb-wlsfemale (default) / male
Celtic, Walescy-gb-wlsfemale (default) / male
German, Germanyde-defemale (default) / male
Spanish, Spaines-esfemale (default) / male
Spanish, USes-usfemale (default) / male
French, Canadafr-cafemale
French, Francefr-frfemale (default) / male
Icelandic, Icelandis-isfemale (default) / male
Italian, Italyit-itfemale (default) / male
Danish, Denmarkda-dkfemale (default) / male
Dutch, Netherlandsnl-nlfemale (default) / male
Norwegian, Norwaynb-nofemale
Polish, Polandpl-plfemale (default) / male
Portuguese, Portugalpt-ptmale
Portuguese, Brazilpt-brfemale (default) / male
Romanian, Romaniaro-rofemale
Russian, Russiaru-rufemale (default) / male
Swedish, Swedensv-sefemale
Turkish, Turkeytr-trfemale

Tips

To introduce a small delay between words or digits you can use a comma (,).

For example: Please enter your activation code 9, 0, 9, 0, in the next 20 minutes.

We support some SSML tags allowing custom breaks or pauses to be entered, and the readout rate to be altered.

More info...

Properties

NameTypeRequiredRestrictionsDescription
tostringtruenoneYour phone number in E.164 format.
bodystringtruenoneBiscuit uv3nlCOjRk croissant chocolate lollipop chocolate muffin.
voicestringtruenoneEither 'female' or 'male'.
custom_stringstringtruenoneYour reference. Will be passed back with all replies and delivery reports.
countrystringtruenoneThe country of the recipient.
sourcestringfalsenoneYour method of sending e.g. 'wordpress', 'php', 'c#'.
list_idinteger(int32)falsenoneYour list ID if sending to a whole list. Can be used instead of 'to'.
langstringfalsenoneau (string, required) - See section on available languages.
scheduleinteger(int32)falsenoneLeave blank for immediate delivery. Your schedule time in unix format http://help.clicksend.com/what-is-a-unix-timestamp
require_inputinteger(int1)falsenoneRecieve a keypress from the recipient. Flag value must be 1 for yes or 0 for no.
machine_detectioninteger(int1)falsenoneDetect answering machine or voicemail and leave a message. Flag value must be 1 for yes or 0 for no.

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
messagesArray of objects
Example: [{"source":"postman","body":"Your verification code is. 1. 2. 3. 4. 5. Again that's. 1, 2, 3, 4, 5.","to":"+61411111111","voice":"male","lang":"en-au","machine_detection":1}]
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"messages\":[
            {
                \"source\":\"php\",
                \"body\":\"Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.\",
                \"to\":\"+61411111111\",
                \"lang\":\"en-au\",
                \"voice\":\"female\",
                \"schedule\":1436874701,
                \"custom_string\":\"this is a test\",
                \"require_input\": 1,
                \"machine_detection\": 1
            },
            {
                \"source\":\"php\",
                \"body\":\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\",
                \"to\":\"+61422222222\",
                \"lang\":\"en-au\",
                \"voice\":\"female\",
                \"schedule\":1436876011,
                \"custom_string\":\"this is a test\"
            }
        ]
    }" \
'https://rest.clicksend.com/v3/voice/send'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

Here are your data.

dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "string", "data": { "total_price": 0.07, "total_count": 1, "queued_count": 1, "messages": [], "_currency": {} } }

Calculate Voice Price

Request

Calculate voice price

Properties

NameTypeRequiredRestrictionsDescription
tostringtruenoneYour phone number in E.164 format.
bodystringtruenoneBiscuit uv3nlCOjRk croissant chocolate lollipop chocolate muffin.
voicestringtruenoneEither 'female' or 'male'.
custom_stringstringtruenoneYour reference. Will be passed back with all replies and delivery reports.
countrystringtruenoneThe country of the recipient.
sourcestringfalsenoneYour method of sending e.g. 'wordpress', 'php', 'c#'.
list_idinteger(int32)falsenoneYour list ID if sending to a whole list. Can be used instead of 'to'.
langstringfalsenoneau (string, required) - See section on available languages.
scheduleinteger(int32)falsenoneLeave blank for immediate delivery. Your schedule time in unix format http://help.clicksend.com/what-is-a-unix-timestamp
require_inputinteger(int1)falsenoneRecieve a keypress from the recipient. Flag value must be 1 for yes or 0 for no.
machine_detectioninteger(int1)falsenoneDetect answering machine or voicemail and leave a message. Flag value must be 1 for yes or 0 for no.

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
messagesArray of objects
Example: [{"source":"php","from":"1234","body":"Hi, this is a test.","to":"+61411111111","voice":"female","lang":"en-au","schedule":"1529086126","custom_string":"this is a test","asdasd":"asdadasd","machine_detection":1}]
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \

     --data-binary "    {
        \"messages\":[
            {
                \"source\":\"php\",
                \"body\":\"Jelly liquorice marshmallow candy carrot cake 4Eyffjs1vL.\",
                \"to\":\"+61411111111\",
                \"lang\":\"en-au\",
                \"voice\":\"female\",
                \"schedule\":1436874701,
                \"custom_string\":\"this is a test\"
            },
            {
                \"source\":\"php\",
                \"body\":\"Chocolate bar icing icing oat cake carrot cake jelly cotton MWEvciEPIr.\",
                \"to\":\"+61422222222\",
                \"lang\":\"en-au\",
                \"voice\":\"female\",
                \"schedule\":1436876011,
                \"custom_string\":\"this is a test\",
                \"require_input\":1
            }
        ]
    }" \
'https://rest.clicksend.com/v3/voice/price'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

Here are your data.

dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "string", "data": { "total_price": 0.07, "total_count": 1, "queued_count": 1, "messages": [], "_currency": {} } }

View Voice Languages

Request

Get all voice languages

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/voice/lang'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here are the possible languages."
dataArray of objects
Example: [{"code":"en-us","country":"English, US","gender":["male","female"]},{"code":"en-au","country":"English, Australia","gender":["male","female"]}]
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here are the possible languages.", "data": [ {}, {} ] }

View Voice Receipts

Request

Get all voice receipts

Push Delivery Receipts

If you prefer, we can push message replies to your server as they arrive with us.

  1. Log into your account.
  2. Click on your profile on the top right.
  3. Then click on the Messaging Settings option.
  4. Click on Voice then Delivery Report Rules.
  5. Click the 'Add New Rule' button.
  6. Select the 'URL' action.
  7. Enter the URL and click 'Save'.

The following variables will be posted to the URL specified:

VariableDescription
timestamp_sendTimestamp of the original send request in UNIX format. e.g 1439173980
timestampTimestamp of delivery report in UNIX format. e.g 1439173981
message_idMessage ID, returned when originally sending the message.
statusDelivered or Undelivered
status_codeStatus code. Refer to 'Voice Delivery Status Codes' in docs.
status_textStatus text.
error_codeError code.
error_textError text.
custom_stringA custom string used when sending the original message.
user_idThe user ID of the user who sent the message.
subaccount_idThe subaccount ID of the user who sent the message.
message_type'voice' (constant).
digitsNumbers the recipient pressed on their keypad during the call. A blank string will be used if they didn't provide any input.

Pull Delivery Receipts

Receive delivery reports by polling. You can poll our server and retrieve delivery reports at a time that suits you.

  1. Log into your account.
  2. Click on your profile on the top right.
  3. Then click on the Messaging Settings option.
  4. Click on Voice then Delivery Report Rules.
  5. Click the 'Add New Rule' button.
  6. Select the 'Poll' action.
  7. Then click 'Save'.

Parameters

ParameterInTypeRequiredDescription
pagequeryinteger(int32)falsePage number
limitqueryinteger(int32)falseNumber of records per page

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/voice/receipts'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here are your delivery receipts."
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here are your delivery receipts.", "data": { "total": 2, "per_page": 15, "current_page": 1, "last_page": 1, "next_page_url": null, "prev_page_url": null, "from": 1, "to": 2, "data": [] } }

Cancel Voice Message

Request

Update voice message status as cancelled

Parameters

ParameterInTypeRequiredDescription
message_idpathstringtrueYour voice message id

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
message_idstringrequired
Headers
Content-Typestring
Example: application/x-www-form-urlencoded
Bodyapplication/json
object
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

'https://rest.clicksend.com/v3/voice/{message_id}/cancel'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Voice have been cancelled."
dataArray of items
Example: []
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Voice have been cancelled.", "data": [] }

Cancel All Voice Messages

Request

Update all voice messages as cancelled

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/x-www-form-urlencoded
Bodyapplication/json
object
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

'https://rest.clicksend.com/v3/voice/cancel-all'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "5 messages have been cancelled."
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "5 messages have been cancelled.", "data": { "count": 5 } }

Get Voice History

Request

Get all voice history

Parameters

ParameterInTypeRequiredDescription
date_fromqueryinteger(int32)falseStart date (Unix Timestamp e.g. 1436849372)
date_toqueryinteger(int32)falseEnd date (Unix Timestamp e.g. 1436879372)
pagequeryinteger(int32)falsePage number
limitqueryinteger(int32)falseNumber of records per page

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Query
date_tostring
limitinteger
Example: limit=20
operatorstring
Example: operator=AND
order_bystring
Example: order_by=date_added:desc
pageinteger
Example: page=1
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/voice/history?date_from=&date_to='

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here is your history."
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here is your history.", "data": { "total": 2, "per_page": 15, "current_page": 1, "last_page": 1, "next_page_url": null, "prev_page_url": null, "from": 1, "to": 2, "data": [] } }

Export Voice History

Request

Export voice history

Parameters

ParameterInTypeRequiredDescription
filenamequerystringtrueFilename to export to

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Query
filenamestring
Example: filename=Voice_history.csv
qstring
order_bystring
Example: order_by=date_added:desc
date_fromstring
date_tostring
limitinteger
Example: limit=50000
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

'https://rest.clicksend.com/v3/voice/history/export?filename={filename}'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Download your file here."
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Download your file here.", "data": { "url": "https://rest.clicksend.com/files/22D55AF9-6CF0-476D-A8B3-82A998FD2738?filename=export.csv" } }