question

System Admin avatar image
System Admin asked ·

Authentication error when connecting to Engage Voice API

Need to download call recordings from Engage Voice but getting an error at the highlighted line.


using (RestClient rc = new RestClient(clientID, secret, false ))
{
TokenInfo token = await rc.Authorize( "<user_name>" , "<ext>" , " <password>" );
var engageVoice = new EngageVoice.EngageVoice(); //
await engageVoice.Authorize(rc.token.access_token);
var httpResponseMessage = await engageVoice.Get( "/voice/api/v1/admin/accounts" );
var s = await httpResponseMessage.Content.ReadAsStringAsync();

Response error:
StatusCode: 401, ReasonPhrase: 'Unauthorized', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
content-security-policy: frame-ancestors 'none';
feature-policy: camera 'none';microphone 'self';geolocation 'none';encrypted-media 'none';payment 'none';speaker 'self';usb 'none';
referrer-policy: strict-origin-when-cross-origin
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-dns-prefetch-control: off
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
Connection: keep-alive
Date: Fri, 12 Feb 2021 20:06:02 GMT
Server: envoy
Content-Length: 14
Content-Type: text/plain
}
Content: Jwt is missing

Request:
Method: GET, RequestUri: ' https://engage.ringcentral.com/voice/api/v1/admin/accounts', Version: 1.1, Content: <null>, Headers:
{
X-User-Agent: EngageVoice.Net/0.1.0
Authorization: Bearer
}
api authengage voice
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Craig Chan avatar image
Craig Chan answered ·

It looks like your exchange for the Engage Token is not working which is probably because you don’t have a valid RC Office Token. Are you using a Developer Sandbox Client credential? If so, you’ll need to move to production for that SDK to work.

1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

System Admin avatar image
System Admin answered ·

How do you exchange the Office Token to Engage Token?

1 comment
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.