API URL Endpoint: https://api.geniq.io/rest/v1/voice
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
message | string | Yes | Body of the Voice message. * Limited to 600 characters. * Please use a single language in the message. Mixing languages may make parts of your message unreadable. | |
recipient | integer | Yes | Recipient’s mobile number including country code without “+” prefix | |
reference | string | Optional | A unique reference ID for keeping track of requests and responses | |
originator | string | Yes | The originator address for the outgoing Voice message. If the given originator address is not whitelisted, a random address will display on the recipient’s phone | |
locale | string | Optional | The voice and language you want to use for the text-to-speech message. Supported languages and voices are detailed here. | en-US |
Sample request using CURL:
$ curl -X POST https://api.geniq.io/rest/v1/voice \
-H 'Authorization: Bearer [TOKEN]' \
-H 'Content-Type: application/json' \
-d '{
"message": "Hi 😀, this is a test message",
"locale": "en-US",
"recipient": "6591234567",
"originator": "6531596518",
"reference": "123",
}' \
Parameters returned in the API response:
PARAMETER | FORMAT | DESCRIPTION |
reference | string | If reference parameter is submitted during the API request, the same value will be returned |
responseMessage | string | Response message returned from the API call |
responseCode | integer | Response code returned from the API call. Refer to section “Response Codes” for list of possible values |
messageIds | array | A list of unique IDs for each Voice sent. |
Sample Response:
{
"reference":"12345",
"responseMessage":"Success",
"responseCode":"0",
"messageIds":["118ad4e0-5014-4466-8593-332b01a20cb7"]
}