News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
RingCentral OAuth 2.0 Grant model.
Tags: sdk
Jun 21, 2016 at 9:48pm   •   7 replies  •  0 likes
mathi-kumar

Dear Team,


We are using RingCentral SDK in our product. Recently we are implementing OAuth 2.0 grant model for user authentication. Though we are able to successfully logged in using RC OAuth 2.0 Authentication.


After receiving the access token we need to get user phone number(direct number) which he was used for RC OAuth login. Then only we can use the same number during RingOut (from field).


Is there any way to find out . I have been searching in the RC Document. Since we were able to get only list of phone number's per account using getPhoneNumber Api Call.It contains all the phone number's for the account.


But we need the phone number which one he was given during RC OAuth login.


Waiting for your response.


Thanks in advance.


Regards,

Mathikumar.C

7 Answers
answered on Jun 30, 2016 at 1:40pm  
Hi Mathikumar,

Could you please create a developer support case (https://developers.ringcentral.com/api/support-cases/create) to help isolate and resolve this issue.
In your support case, please reference the URL for this community post, and inform them that you've been asked to have this issue directly escalated to Tier 2 developer support.

 1
answered on Jun 24, 2016 at 12:54am  
Hi Dean,

Thanks for your response.

As in my  previous comment there is only one direct number for extension id. But for customer there might be a one or more direct number can be mapped to same extension id. So i think  that end point will not work to choose one particular phone number for RIngOut.

We need to give choice to customer to choose which number customer wants to use for RIngOut Process.

Regards,
Mathikumar.C

 0
answered on Jun 24, 2016 at 12:47am  
Dear John,

Much appreciate for your quick response. 
 
I decided to go in your way to give choice to customer to choose phone number after successful login.

So, For the first select element(RingCentral Phones) i can use "account/~/extension/~/phone-number" endpoint to get Customer's RingCentral phone numbers.

In second select element(Other Phones) i will use "account/~/extension~/forwarding-number"  endpoint to get other phones what customer have in RingCentral Online Portal (Call handling & Forwarding).

According to customer's choice of phone number, we will make "from" field during RingOut process.

Hope this will be a better idea. 

Could you please suggest us if you feel any changes.

Regards,
Mathikumar.C

 0
answered on Jun 23, 2016 at 2:10pm  
Hi Mathi,

A correction is necessary for the above. To select calling phone numbers for RingOut, you must use the "account/~/extension~/forwarding-number" endpoint and filter for phone numbers with the "CallForwarding" feature.

The "account/~/extension~/phone-number" endpoint is used for finding phone numbers that can be used for the Caller ID. Currently, the RingOut API does not support setting the Caller ID value and uses the Caller ID setting set in the Online Account Portal under the "RingOut for Web" feature. To configure a Caller ID via an API call, consider using WebRTC.

Some additional information is available here:

  1. https://developer.ringcentral.com/api-docs/latest/index.html#!#MakeRingOut.html
  2. http://ringcentral-sdk-ruby.readthedocs.io/en/latest/usage/voice/Click-To-Call/

If more than one phone number is available in the account under "forwarding-number" with the "CallForwarding" feature, that means the user can receive calls on more than one number. Best practices is to create a select element and allow the user to choose which number to use.

Thanks,
John

 1
answered on Jun 23, 2016 at 10:16am  
These are two numbers available for the same user. You can tell by looking at the "usageType" values. In your case, one is the "MainCompanyNumber" (which the user is able to use for dialing) the other is the "DirectNumber" (which the user is also able to use for dialing).

According to your original question, "After receiving the access token we need to get user phone number(direct number) which he was used for RC OAuth login.".

So in this case, you would want to use the phone-number.id where usageType = "DirectNumber". (id AAAAAAA in your example response)

Does this answer your question?

 0
answered on Jun 23, 2016 at 3:25am  
Dear John Wang,

Greetings!!!

Thanks for your reply.

After successful RingCentral login(after getting access token) I have called above (account/~/extension/~/phone-number) apiCall to get particular phone number which one i was used during OAuth RIngCentral login(1XXXXXXXXXX). 

But i got below response as list of phone numbers. But we need the phone number which was  given during RingCentral OAuth login. Then only we can use the same phone number during ring-out (from field) .

Hope this is clears.

Could you please let me know if any further information is needed. 

 {  "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/665168005/extension/665168005/phone-nu...;,
  "records" : [ {
    "id" : ZZZZZZZZ,
    "phoneNumber" : "+1XXXXXXXXXX",
    "paymentType" : "Local",
    "location" : "Alamitos, CA",
    "type" : "VoiceFax",
    "usageType" : "MainCompanyNumber",
    "features" : [ "SmsSender", "CallerId" ],
    "status" : "Normal",
    "country" : {
      "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/country/1";,
      "id" : "1",
      "name" : "United States"
    }
  }, {
    "id" : AAAAAAAA,
    "phoneNumber" : "+1YYYYYYYYYYY",
    "paymentType" : "Local",
    "location" : "Philadelphia, PA",
    "type" : "VoiceFax",
    "usageType" : "DirectNumber",
    "features" : [ "SmsSender", "CallerId" ],
    "status" : "Normal",
    "country" : {
      "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/dictionary/country/1";,
      "id" : "1",
      "name" : "United States"
    }
  } ],


Regards,
Mathikumar.C


 0
answered on Jun 22, 2016 at 10:26am  
You can retrieve a user's phone numbers by calling the extension phone number endpoint (e.g. "account/~/extension/~/phone-number" which is described below:

https://developer.ringcentral.com/api-docs/latest/index.html#!#RefExtensionPhoneNumbers.html

A RingCentral user has an extension which can have multiple phone numbers. Using the above endpoint, you'll receive only the phone numbers associated with that user.

Since a user can login with any of their phone numbers, e.g. main company number + extension, digital line number, direct number, etc., our best practices is to allow a user to login with any number and after doing so, making available all their numbers for use, e.g. voice calls, SMS, fax, etc.

Let us know if that helps.

 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us