1. Home
  2. Docs
  3. Voice
  4. Send Voice Message

Send Voice Message

API URL Endpoint:
https://api.geniq.io/rest/v1/voice

PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
messagestringYesBody of the SMS message
recipientintegerYesRecipient’s mobile number including country code without “+” prefix
referencestringOptionalA unique reference ID for keeping track of requests and responses
originatorstringYesThe 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
maxDurationintegerYesThe max duration of the call in seconds (max 14400 seconds). If the call is still connected at that time, it will be automatically disconnected.
menusarrayOptionalThe 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:

PARAMETERFORMATDESCRIPTION
referencestringIf reference parameter is submitted during the API request, the same value will be returned
responseMessagestringResponse message returned from the API call
responseCodeintegerResponse code returned from the API call. Refer to section “Response Codes” for list of possible values
messageIdstringA unique ID for the sent SMS.

Sample Response:

{
    "reference":"12345",
    "responseMessage":"Success",
    "responseCode":"0",
    "messageId":"76CEEFFFD89C9193391D631A9EE74E27"
}