Text to speech
The text to speech API is used to connect the call and read our text to speech to the caller, which is useful for converting dynamic text into a human-sounding voice. Using app id and app secret you can able to make a text to speech API request.
Base URL
Send your POST method request with valid parameters, to the following base URL.
https://rest.telecmi.com/v2/global_pcmo_make_call
Required Parameters
These are the required POST method parameters with description
Parameter Name | Type | Description |
---|---|---|
*appid | number | Your app id |
*secret | string | Your app secret |
*from | number | Your caller id for this call |
*to | number | The number the call was made to |
extra_params | string | Your custom parameters |
*pcmo | array object | The PCMO should return the text to speech |
Note The * marked property is mandatory. |
Sample JSON Request
Below is the following sample JSON POST method request
{
"appid": 2222226,
"secret": "xxxx-xxxx-xxxx-xxxx",
"from": 19170000000,
"to": 19170000001,
"extra_params": { "key": "value" },
"pcmo": [
{
"action": "speak",
"text": "Hello. Your one time password is. 9. 8. 9. 7"
}
]
}
Sample Response
If the provided information is valid, your web server will get a sample response from TeleCMI Platform as given below
{
"data": {
"status": "progress",
"request_id": "FrTckxcdYpJQFwSwki7ee2qY90MOYhgRyFzqgSlK5uT"
},
"status": "progress",
"request_id": "FrTckxcdYpJQFwSwki7ee2qY90MOYhgRyFzqgSlK5uT",
"code": 200
}
Properties
These are the list of properties and its description
Property | Type | Description |
---|---|---|
status | string | The Status of the call |
request_id | string | The Unique ID for this |
HTTP status codes
TeleCMI API platform represents the following status code to identity the errors.
Status code | Status code | Description |
---|---|---|
200 | OK | We received the request |
420 | Error | Invalid app id or secret, failed to authenticate token |
422 | Error | Missing required property |
502 | Error | The property required is missing |