question

gaash-granot6752 avatar image
gaash-granot6752 asked John Wang Deactivated commented

Resource for parameter [accountId] is not found

hi,


i'm trying to get a customer's calls for the first time, but i get the error message in the subject.


the flow that was used:

1. the customer has authorized my application using the authentication flow (i got an access key using ring central's APIs).


2. using the following API, i tried to get the customer's extensions list, but got the error message.

the url i'm using is -

https://platform.ringcentral.com/restapi/v1.0/account/<ACCOUNT-NUMBER>/extension

(i use an account number, not the '~' sign).


3. i used my account in ring central to check the code i wrote, and noticed that when i use a user, that is defined as an admin in ring central, the APIs work without any problem, but when i use a standard user (not an admin), i also get the error in the subject.


my questions are:

1. when granting access, only an admin user can be used during authentication, in order to grant the access to the customer's data?


2. if a standard user can be used to grant access, then what am i doing wrong?


thanks :)


errors
1 |3000

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

ak avatar image
ak answered
Hi Gaash,

The  GET Extension List API would return the list of extensions created for a particular account. All types of extensions are included in this list.

Now, in order to get the extensions list under an account, you need not be an Admin to make this API request. The GET Extensions List can be retrieved using an Admin or a non-Admin User. 

Based on the description you have provided above, it looks like the  <ACCOUNT-NUMBER> that you are providing might not actually belong to the Organization or the account itself.Using a '~' ( tilde ) should work for the logged-in user.

Can you verify if '~' works or not?
1 |3000

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

gaash-granot6765 avatar image
gaash-granot6765 answered John Wang Deactivated commented
hi thanks for the reply. unfortunatelly, the tilde sign won't help, since there's no looged-in user. the API is executed in a fully back-end system, as part of a batch process. what else can be the cause for the error? how can it be, that an admin user authorization works, and a stardatd user doesn't?
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.

John Wang avatar image John Wang ♦♦ commented ·
To access customer account data, you need to have a logged in user's access token. You cannot access customer data without such authorization. If you wish to access a user's data you should use OAuth to get an access token for the user and then use that access token to retrieve the user's account data.

Regarding your questions in the OP:

1. when granting access, only an admin user can be used during authentication, in order to grant the access to the customer's data?

It depends on that data in question, but both admin and standard users can retrieve the extension list, e.g. "account/~/extension".

2. if a standard user can be used to grant access, then what am i doing wrong?

From the above, it seems you are trying to access the data without a logged in user's access token, which is necessary. If you have an access token for a standard user and are accessing that user's account, e.g. "account/~/extension" or using the accountId retrieved from "account/~" there is some other issue with the code.
0 Likes 0 ·
ak avatar image
ak answered
unfortunatelly, the tilde sign won't help, since there's no looged-in user. the API is executed in a fully back-end system, as part of a batch process. 
What is the user you are Authorizing as to make the API request ? Would that user be a part of the organization / account ?

Per the error, I can think of it as you are authorized as a user A but then the <AccountID> which you are using in the API to retrieve the list of extensions does not belong to the same org / account as the user A

1 |3000

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

Tyler Liu avatar image
Tyler Liu answered
There is a logged-in user as long as you have the access token. "account/~" means the account which contains the user that you used to obtain the access token.

It is true that the access token is unable to fetch information from other accounts. Only fetch information from the current account is possible.
1 |3000

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

gaash-granot6752 avatar image
gaash-granot6752 answered John Wang Deactivated commented
ok, thank you all for your answers.
i checked if the code works when i'm using the '~' sign instead of the account id, using the access token that was created when the standard user granted access, and it worked fine.

then, i checked what was the value of the account id i was using, and it turned out to be ring central owner id. this is actually a bug in my code, but it made me wonder:
how come, that when i used the owner id of an admin user in ring central, it worked fine, and i also managed to get other extensions calls?
how is it possible?

thanks.

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.

John Wang avatar image John Wang ♦♦ commented ·
The extensionId for the Super Admin user (typically extension 101) and the accountId are the same number, while the extensionId for standard users are different than the user's accountId.
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