voice api not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 04:44 AM
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();
- Labels:
-
Voice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 12:48 AM
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();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 05:11 AM
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.
Webex Connect
