This API is used to enable/disable voice functionality at app level.
Request Parameters
Key | Description | Value | Data type | Required/Optional | Constraints |
---|---|---|---|---|---|
Authorization | app Token for the application | {{APP_TOKEN} | String | Required | Should be a valid Partner app token |
appId | App for which the data needs to be updated | {{APP_ID}} | String | Required | App should be in the account whose api key is being used |
enable | To enable pass true else pass false. | {{ENABLE}} | Boolean | Required | enable is true/false. Mandatory fields |
iconVisibility |
| Supported Values: Default Value: Default (Call icon will be visible for end user in the chat) | String | ||
mode | Mode of usage of whatspp voice | Supported Values:- | |||
metaData | SIP configuration data when using GS-SIP | JSON Array example: mention below request | Mandatory when using GS-SIP mode |
Sample Request
Enablement of voice for an app of a partner (Using WA API)
curl --location '{PARTNER_PORTAL_BASE_URL}/partner/app/{appId}/voice' \
--header 'Authorization: {app_token}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'enable={VOICE_STATUS}' \
--data-urlencode 'iconVisibility={ICON_VISIBILITY}' \
--data-urlencode 'mode={VOICE_MODE}' \
--data-urlencode 'metaData={METADATA_FOR_SIP in JSON}'
Below is an example of the SIP configuration metadata format
[
{
"is_register": false,
"user": "911XXXX258312",
"username": "911XXXX258312",
"host": "ip-XX-232-3-XX.ap-XXXXX-1.compute.internal",
"port": "5071",
"secret_key": "XXXXXXXXX18fc94ac1488b86c0XXXXXX",
"force_tcp": false
}
]
Sample Response
{
"message": "Whatsapp voice status updated to true",
"status": "success"
}
Status Codes
Status Code | Response | Comments | |
---|---|---|---|
Success | |||
200 | { "message": "Whatsapp voice status updated to true", "status": "success" } | ||
Error | |||
401 | { "message": "Authentication Failed", "status": "error" } | When API key authentication fails | |
500 | { "message": "Error occurred while updating whatsapp voice status, please try again later.", status": "error" } |