Skip to main content
Solved

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?

Best answer by PhongVu

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!

View original
Did this thread help you find an answer to your question?

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • April 12, 2022

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!


  • New Participant
  • April 13, 2022

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?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings