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
I have done authorization using OAuth but I don't know what number I used to auth?
Tags: oauth
Sep 6, 2017 at 10:26am   •   3 replies  •  0 likes
hamb-

I have done authorization using OAuth but I don't know what number I used to auth? Is it possible to know the exact number the user have used to authorize?

3 Answers
answered on Sep 16, 2017 at 10:03am  
Here is the screenshot of the API Explorer.

You just click the Try It button without providing the extension Id.

If it does not work with you code, what error did you get? Can you post the response from the server?

 1
answered on Sep 16, 2017 at 5:13am  
This is not working for me,
Can you please tell in API Explorer ?

 0
answered on Sep 6, 2017 at 10:58am  
Short answer: Yes, you can if you have the valid accessToken. You can call the Extension Info endpoint using the accessToken.

It would be much easier to use one of our official SDKs to do this. Here is some code snippet using the Node JS SDK.

var rcsdk = new RC({
    server: https://platform.devtest.ringcentral.com,
    appKey: your_app_key,
    appSecret: your_app_secret
});
var platform = rcsdk.platform();
var data = platform.auth().data();
        data.token_type = "bearer"
        data.expires_in = 86400
        data.refresh_token_expires_in = 86400
        data.access_token = "THE accessToken"
        platform.auth().setData(data)
        platform.get('/account/~/extension/~/')
          .then(function(response) {
              var jsonObj =response.json();
              var extensionNumber = jsonObj.extensionNumber
              var userName = jsonObj.name
          })
          .catch(function(e) {
              console.log("Failed")
              console.error(e);
              throw e;
          });

Hope this helps!
Phong Vu

 1



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