question

ashley1172 avatar image
ashley1172 asked benjamin-dean commented

Setting up test Users in Sandbox to retrieve via API

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.











topic-default
1 |1000

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

ashley1172 avatar image
ashley1172 answered
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.



1 |1000

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

benjamin-dean avatar image
benjamin-dean answered benjamin-dean commented
Thanks for the update Ashley,

What URI are you using to fetch this please?
2 comments
1 |1000

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

ashley1172 avatar image ashley1172 commented ·
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) 
0 Likes 0 ·
benjamin-dean avatar image benjamin-dean commented ·
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. :)
0 Likes 0 ·

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.