question

Christine Dutra avatar image
Christine Dutra asked Phong Vu commented

Retrieve all user details with attributes (email, extensions)

How can I access all users through API? I have an admin user and I can see all users listed on UI when i logged in as a user in the Ringcentral portal.

When I want to achieve the same functionality through API, First I do not see any availability of 'client_credential' flow. I see only 'password' flow when I select no UI option.

When I call following API

https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~

It gives only main admin user details with the extension. I was expecting all the extension details here.

If I pass extension explicitly then I can get data for other extensions (and assigned user) details. For example, if there are 2 extensions - 1234, 4567 - I need to call v1.0/account/~/extension/4567 to get the details.

My need is that I need to find active calls of a user based on email id. Active call details can be fetched for an extension only.

I was hoping to get all users' information - scan their email ids and find appropriate extension -> and then call the Active call API. I am stuck at getting all user information step only at this point.

Thanks in advance for any hint, please.

emailaccountsactive callsclient_credentials
1 |1000

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

1 Answer

·
Phong Vu avatar image
Phong Vu answered Phong Vu commented

You said "client_credential" flow, do you refer to the OAuth (3 legged authentication)? If yes, check out this quick start and choose your programming language.


As an admin, you can read all extensions by using the Get Extension List endpoint. The response contains an array of records with each record contains an extension info. The email and other info is under the contact object.

If you want to map an active call with an extension's email, you have to read all extensions with the API mentioned above, keep their email and id in a list then use the id to match an active call "extensionId" (under the "from" or the "to" object depending on the direction of that active call)


Hope this helps.

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.

Christine Dutra avatar image Christine Dutra commented ·

yes, this API has what I need - thank you.


The app I am working on is purely backend API with no user interaction so Authorization code is not the best OAuth flow for app. I am not sure why RingCentral does not allow any app with this machine to machine OAuth flow. It's very much standard for other similar applications i have interfaced with and does not require me to pass user credentials.

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Christine Dutra commented ·

You meant using API key as other services?

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.