question

System Admin avatar image
System Admin asked Craig Chan commented

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
}
rest api
1 |3000

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 |3000

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 Craig Chan commented

How do you exchange the Office Token to Engage Token?

1 comment
1 |3000

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

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys