question

Sierra Gold2 avatar image
Sierra Gold2 asked Sierra Gold2 answered

Permissions errors in API call after creating new application

Hoping to get some help here as I have ran a ton of tests to confirm that this issue is not caused by something I am doing wrong. I currently have an app that makes calls to API to collect call log info. That app is working fine and is in production. Recently, I needed to add some permissions to the app and since you cannot do that in a production app, I created a new one with the same permissions as the old one and a couple more. During that process, it had also created me a new sandbox account since the one I used for the original app had expired. This new sandbox account had a new phone # and extension associated with it. Didn't seem that it would be a big deal but it is. I can request the token just fine and the response comes back with the appropriate permissions:

"access_token": "xxxxxxxxxxxxx....", "token_type": "bearer", "expires_in": 3600, "scope": "ReadMessages ReadAccounts SMS ReadCallLog",

Even doing a simple test in postman using that token to the call-log endpoint, it generates a permission error

POST:
https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/call-log

Header contains the Authorization key with a value of Bearer followed by the token returned from the response above but states insufficient permissions.

"errorCode" : "InsufficientPermissions" , "message" : "In order to call this API endpoint, one of the following permissions
[ReadCompanyCallLog] have to be granted to the authorized user."
,
"errors" : [ { "errorCode" : "CMN-408" ,
"message" : "In order to call this API endpoint, one of the following permissions [ReadCompanyCallLog] have to be
granted to the authorized user."
,
"permissionsName" : "ReadCompanyCallLog" } ],
"permissionsName" : "ReadCompanyCallLog"


Not sure what the issue is here but I have tried different methods to send the post requests and nothing is working. Oddly, if I use the API explorer and use the "Try it out", it works fine but any request outside that environment is not working, aside from the app I already have it production so it just appears to affect the calls to the dev area. Any ideas?

rest apideveloper sandboxpermissionsget token
1 |3000

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

Phong Vu avatar image
Phong Vu answered

It means that you authenticate the app with a user who does not have enough user permission to access the call log at the account level. You will need to change the role of that user from "standard" (I guessed) to "super admin" role. Or create a custom role and choose the user permission as shown in the error message and assign that role to that user and authenticate the app again.

1 |3000

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

Sierra Gold2 avatar image
Sierra Gold2 answered

Awesome, thank you. Yeah, I was not aware permissions had to be configured for sandbox users. I accessed the user portal for the sandbox user and changed the user role to super admin and it is working now.

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