API URL Endpoint:
https://api.geniq.io/rest/v1/voice
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
message | string | Yes | Body of the SMS message | |
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 SMS message. If the given originator address is not whitelisted, a random address will display on the recipient’s phone | |
maxDuration | integer | Yes | The max duration of the call in seconds (max 14400 seconds). If the call is still connected at that time, it will be automatically disconnected. | |
menus | array | Optional | The menu allows the recipient to give respond to the caller by pressing the number pad on the phone. |
Sample request using CURL:
Sample 1:
$ curl -X POST https://api.geniq.io/rest/v1/voice \
-H 'Authorization: Basic dXNlcjE6cGFzczE=' \
-H 'Content-Type: application/json' \
-d '{
"message": "Hi 😀, this is a test message",
"recipient": "6591234567",
"originator": "6531596518",
"maxDuration": 30,
"reference": "123"
}' \
Sample 2:
$ curl -X POST https://api.geniq.io/rest/v1/voice \
-H 'Authorization: Basic dXNlcjE6cGFzczE=' \
-H 'Content-Type: application/json' \
-d '{
"message": "Hi, press 1 to subscribe to the event, and press 2 to exit",
"recipient": "6591234567",
"originator": "6531596518",
"maxDuration": 30,
"menus": [
{
"dtmf": "1"
},
{
"dtmf": "2"
}
],
"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 |
messageId | string | A unique ID for the sent SMS. |
Sample Response:
{
"reference":"12345",
"responseMessage":"Success",
"responseCode":"0",
"messageId":"76CEEFFFD89C9193391D631A9EE74E27"
}