cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
285
Views
0
Helpful
2
Replies

voice api not working

kmehta
Level 1
Level 1

Hi Team, I am using below code in my solution with the trial account I have but am unable to place voice call and getting 400 error each time. Please advise:

 

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api-sandbox.imiconnect.io/v1/voice/messages");
request.Headers.Add("Authorization", {my authorization key});
request.Headers.Add("Idempotency-Key", Guid.NewGuid().ToString());
var content = new StringContent("{\n \"callerId\": \"+15204575696\",\n \"dialedNumber\": \"{my indian telephone number}\",\n \"audio\": {\n \"type\": \"TTS\",\n \"loop\": 3,\n \"style\": \"STANDARD\",\n \"gender\": \"FEMALE\",\n \"engine\": \"AZURE\",\n \"text\": \"Hello\",\n \"textFormat\": \"TEXT\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();

2 Replies 2

kmehta
Level 1
Level 1

Hi Team, I am using below code in my solution with the trial account I have but am unable to place voice call and getting 400 error each time. Please advise:

 

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api-sandbox.imiconnect.io/v1/voice/messages");
request.Headers.Add("Authorization", {my authorization key});
request.Headers.Add("Idempotency-Key", Guid.NewGuid().ToString());
var content = new StringContent("{\n \"callerId\": \"+15204575696\",\n \"dialedNumber\": \"{my indian telephone number}\",\n \"audio\": {\n \"type\": \"TTS\",\n \"loop\": 3,\n \"style\": \"STANDARD\",\n \"gender\": \"FEMALE\",\n \"engine\": \"AZURE\",\n \"text\": \"Hello\",\n \"textFormat\": \"TEXT\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();

Connect - Tanuj
Cisco Employee
Cisco Employee

Hi @kmehta - Please use NEURAL as value for the TTS style configuration. The above request is failing because STANDARD voice option is being retired. Let me know if you continue to face any issues after making this change.

 

Tanuj Goyal
Webex Connect