Skip to main content

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?

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
This is not working for me,
Can you please tell in API Explorer ?
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?

Reply