Setting up test Users in Sandbox to retrieve via API

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I'm looking for some explanation on the set up of Users for the Sandbox Account.

We have the Sandbox account set up which the admin user can log in.  There is currently the admin user (verified) and three other users which have not been verified by email (that's another issue that the Resend Welcome Email does not work).

The App has also been linked up with the Sandbox (I can see it in Authorized Apps in the Sandbox portal).  I can successfully create a OAuth token using the Sandbox details - username, and password.

I am then able to make a call to https://platform.devtest.ringcentral.com/restapi/v1.0/account/~
which returns the current operator(s)... is that correct?  Since the other three have not been verfied (and hence are not logged in) they are not returned.

However, I'm struggling to grasp why I am unable to retrieve the operators details IF I have the AccountId and the Extension of the operator.  Is it because they are not verified?

I assume (when they are veriifed) that the call would easily be:

https://platform.devtest.ringcentral.com/restapi/v1.0/account/<ACCOUNT_ID>/extension/<EXTENSION_NUMBER>

However I am unable to set up users in the Sandbox to actually get there details via the API as the the Resend Welcome Email doesn't seem to work ( I have clicked it a number of times for setting up a test user).

Any help would be much appreciated.
Photo of Ashley

Ashley

  • 120 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Ashley

Ashley

  • 120 Points 100 badge 2x thumb
I've made some progress.


The Resend Welcome Email wasn't sending to my work address so I have set it to Gmail and I received it.

So, I have now set up my test user on the Sandbox and I can authenticate this user via the API and receive a Token.

HOWEVER, I am still unable to successfully get a non error response when I call the operator's account itself.

I inserted the Bearer <TEST USER TOKEN> Header and this works for the Admin user but not for the test user.

Returns with:

{
  "errorCode" : "InvalidParameter",
  "message" : "Resource for parameter [accountId] is not found",
  "errors" : [ {
    "errorCode" : "CMN-102",
    "message" : "Resource for parameter [accountId] is not found",
    "parameterName" : "accountId"
  } ],
  "parameterName" : "accountId"
}


I do know the Account ID exists - I navigate to the User's detail and grab the ID from the URL (or I download the list of users and use the MailBox ID).  Is that correct?

Again, help would be much appreciated.
Photo of Benjamin Dean

Benjamin Dean

  • 8,602 Points 5k badge 2x thumb
Thanks for the update Ashley,

What URI are you using to fetch this please?
Photo of Ashley

Ashley

  • 120 Points 100 badge 2x thumb
Apologies - I believe jumping backand forth between the browser tabs that I was using the wrong Bearer values.

Once I adjusted that I then just used the ~ to retrieve the currently logged in user (which should be associated with the Bearer value) 
Photo of Benjamin Dean

Benjamin Dean

  • 8,602 Points 5k badge 2x thumb
You got it! Using the tilda '~' is a shortcut way of representing the currently logged in user (in place of hard ID values). Thanks for sharing and glad you were able to get things working for yourself. :)