question

Polina Zubova avatar image
Polina Zubova asked Polina Zubova edited

API Team Messaging > Profile > Get Person how to get phoneNumbers

I have a user in favorites chats which I can't find by id in internal contacts https://developers.ringcentral.com/api-reference/Internal-Contacts/listDirectoryEntries and in external contacts https://developers.ringcentral.com/api-reference/External-Contacts/listContacts

Only way I can find information about this user is using https://developers.ringcentral.com/api-reference/Profile/readGlipPerson , but there is no phoneNumbers.

In ACOapp I can see phoneNumbers of the user.

So the question is how can I get phoneNumbers of such users using API?

phonerest apicontacts
1 |3000

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 Polina Zubova edited

First of all, you will not get a user's phone number from the Glip Person API as phone number is not required by Team Messaging.

There are 2 kind of user types in a chat, a team or a conversation, internal user or external user. You can read the phone number(s) of an internal user using the API chain below:

1. Read your account info to get the account id (if you don't know it)

2. Read the team/chat/conversation and parse the members array to get their id

3. Read the user profile of each member using the member id

4. Compare the account id (read from step 1) with the 'companyId' in the response from step 3. If the Ids match, it is an internal user => Read the user phone number. Else => ignore external user

5. Read extension phone numbers


Hope this helps!

3 comments
1 |3000

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

Hi @Phong Vu , thanks for the quick response.

Is there any way to get phoneNumbers of person not from my company?

For example,

I'm contact A from company A and I have a team with member -> contact B from company B.

From team members I know only id of contact B, using https://developers.ringcentral.com/api-reference/Profile/readGlipPerson with id I can get some information about contact B, but there is no extension and phoneNumbers.

I want to call him, is there a way how I can get his phoneNumbers using API?

0 Likes 0 ·

No. As you can see form the RC app, open an external member and look at their profile, you won't see their phone number. Not only this is not supported, this should not be allowed to freely read other accounts' user phone number.

-1 Like -1 ·

Hi @Phong Vu , thanks for the response.

BTW it looks very strange to me, as if I login with @avaya.com user in ACO (https://app.cloudoffice.avaya.com/) which is RC app(I login with RC account there) and open team with members from different companies. I can open profile of user with @ringcentral.com(for example) and I can see phoneNumbers of this user. But through API I can't get phoneNumbers of this user.

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