Creating a Voice Notification (V1.0.0) (createVoiceNotification)
Scenario
When the voice notification function is used, this API is invoked to request the voice call platform to play a voice notification to a specified user.
Method
POST
URI
https://Domain name/apiaccess/rest/voiceNotification/v1/createVoiceNotification (For example, the domain name is service.besclouds.com.)
Request Description
No. |
Parameter |
Type |
Mandatory or Not |
Description |
---|---|---|---|---|
1 |
X-APP-Key |
String |
Yes |
App key field, which is the user ID. Contact the operation personnel to obtain the app key. |
2 |
Authorization |
String |
Yes |
Authentication field. The format is Bearer {Value of AccessToken returned by the tokenByAkSk interface}. (A space is required after Bearer.) For details about the generation mode, see C1 System Configuration Interface Authentication. |
No. |
Parameter |
Type |
Mandatory or Not |
Description |
---|---|---|---|---|
1 |
reqBody |
Object |
Yes |
- |
1.1 |
voiceContent |
String |
Yes |
The value contains a maximum of 1000 characters.
|
1.2 |
callerPresent |
String |
No |
Calling number displayed on the user side. If this parameter is not carried, the access code of the tenant space is used by default. If this parameter is carried, the access code must be carried. If a non-access code number needs to be transferred, contact O&M personnel to enable the calling number anonymization feature. After this feature is enabled, the number verification rule is as follows: access code or a number of 11 to 14 digits. |
1.3 |
called |
String |
Yes |
Called number. |
1.4 |
callBackUrl |
String |
No |
URL for a customer to receive status reports. Use Base64 to encrypt this parameter using the UTF-8 standard character set. The AICC pushes the call status information during business triggering to the server, and the client server determines the user status based on the call status information. The URL can be set to https://IP address:Port number or a domain name. The domain name is recommended. HTTP and HTTPS are supported. The domain name can correspond to multiple servers to ensure that notifications can be received when a single point of failure occurs. HTTP involves security risks and is not recommended. The URL can contain only letters, digits , and the following special characters: -:./_#?& The IP address and port number, or domain name of the URL must have been added to the mobile agent callback URL trustlist by the system administrator. |
1.5 |
priority |
String |
No |
Playback priority of a voice notification. The value is an integer ranging from 1 to 9. The default value is 9. A smaller value indicates a higher priority. |
If TTS is involved, sign in to the AICC as a system administrator, choose
, and specify the TTS vendor. The configuration takes effect one minute later.Response Description
- Status code: 200
Table 3 Response body parameters No.
Parameter
Type
Mandatory or Not
Description
1
schema
Object
Yes
-
1.1
retCode
String
Yes
Returned code (0 indicates success).
1: A task is in progress. Try again later.
2: The value length of callData exceeds 1024 characters.
3: Creation failed. No call SN is generated.
4: The format of softphone does not match the rule.
5: The value of caller or called is not transferred, or the format does not match the rule.
6: The VDN is not enabled.
7: callerPresent or agentPresent fails to pass the verification.
8: The value of voiceContent is empty, exceeds the upper limit, or does not exist.
9: The value of callBackUrl does not meet the requirements.
16: The tenant is in trial commercial use state, and the called number is not in the trustlist.
36: The value of priority is in an incorrect format.
1.2
retMsg
String
No
Return result description.
1.3
result
Object
No
This parameter is mandatory when retCode is set to 0.
1.3.1
callSerialNo
String
Yes
Call SN.
- Status code: 400
Incorrect request. Check the request path and parameters.
- Status code: 401
Unauthorized operation.
1. Check whether you have purchased related services.
2. Contact customer service to check the status of your account.
- Status code: 403
Authentication fails.
- Status code: 404
The requested content is not found. Check the request path.
- Status code: 500
Business failure. Check the values of parameters in the request.
Error Codes
None
Example
Request header:
{ "Content-Type": application/json "x-app-key": ***** "Authorization": Bearer **** }
Request parameters:
{ "voiceContent": "1133*********999~$Tom$~2225*********149", "callerPresent": null, "called": "88880000" }
Response parameters:
{ "result": { "callSerialNo": "11827********7090" }, "retCode": "0", "retMsg": "Created successfully." }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot