question

Franklin Paula avatar image
Franklin Paula asked Franklin Paula commented

Engage Voice API not working Node.js

Hello guys, so I'm trying to use the engage voice API as this documentation https://developers.ringcentral.com/engage/voice/guide/authentication/auth-ringcentral, at the moment I get the Bearer Access Token for engage voice API as this documentation https://engage.ringcentral.com/api/auth/login/rc/accesstoken, with no problems, but when I'm trying to use it on any engage URL like a simple request

    const getTest = await axios.get(
      `https://engage.ringcentral.com/voice/api/v1/admin/users`,
      {
        headers: {
          Authorization: `Bearer ${engageToken.data.accessToken}`,
          // Accept: 'application/json',
        },
      },
    );

I'm always getting an error "

HTTP Status 401 – Unauthorized

"

I'm following the documentation to the letter but the error is all the time on any request to the engage API.

So please I need some help about this.

Thanks !

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

This sounds like a permission issue. Is the user you are logging in with an admin user with read permissions?

1 |3000

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

Franklin Paula avatar image
Franklin Paula answered Franklin Paula commented

Is the admin user and the app has this 2 permissions Read Accounts, Read Presence

2 comments
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 ♦ commented ·

The two permissions (Read Accounts, Read Presence) are from RingCentral Office and Read Accounts is needed to receive an Engage Voice token. However, this does not mean the user for Engage Voice is an admin or has the right permissions. When you go to https://engage.ringcentral.com and login, what do you see? If you see 2-3 icons, then you likely have one icon that shows "Admin". If you just go to a screen where it asks you which queues or which campaigns, then you might have Agent only permissions.

Here's a guide about roles in Engage Voice: https://support.ringcentral.com/engagevoice/admin/voice-admin-roles-overview.html

1 Like 1 ·
Franklin Paula avatar image Franklin Paula Craig Chan ♦ commented ·

Thanks a lot !! This was the exact problem !! I really appreciated the help

0 Likes 0 ·

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