AI Streaming
Each API request in TeleCMI platform includes App id and secret. Get your App id and secret in TeleCMI dashboard. After getting the app id and secret, make a POST request to the below base URL to enable or disable streaming.
Base URL
Send your POST method request with valid parameters, to the following base URL.
https://rest.telecmi.com/v2/setting/stream
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 |
*enable | boolean | Set to true to enable streaming or false to disable it. |
*ws_url | string | The WebSocket URL where the audio stream will be sent. |
*listen_mode | string | Determines which part of the call audio is captured and stored
|
Note
All the above parameters are mandatory.
Sample JSON Request
Below is the following sample JSON POST method request
{
"appid": 2221121,
"secret": "122xxxx-xxxx-xxxx-xxxx-xxxxa25",
"enable": true,
"ws_url": "ws://example.tcp.ngrok.url",
"listen_mode": "caller"
}
Sample Response
If the provided information is valid, your web server will get a sample response from TeleCMI Platform as given below
{
"code": 200,
"msg": "Stream Enabled"
}
HTTP status codes
TeleCMI API platform represents the following status code to identity the errors.
Status code | Status type | Description |
---|---|---|
200 | OK | Stream Enabled,Stream Disabled |
404 | Error | Authentication failed |
500 | Error | Invalid Listener Mode |