question

Kiran Sutar avatar image
Kiran Sutar asked Kiran Sutar commented

Get Refresh Token

How can we get access token using refresh token. is it possible. Can you please guide me for this ?

I want to implement that on server side in node typescript and what header , body required for this ?

Please help me out.

Thank You In Advance.

get token
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 Kiran Sutar commented

Are you sure about what you asked? People uses a refresh token to get a new access token. You want the other way around and it is not possible.

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.

Kiran Sutar avatar image Kiran Sutar commented ·

Hey @Phong Vu My bad. How can I get access token using refresh token using client ID and client secrete. or any other all possible way. Can you please suggest/share with me.

Thanks

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Kiran Sutar commented ·
var endpoint = '/restapi/oauth/token'
var url = 'platform.devtest.ringcentral.com'
var basic = [RC_CLIENT_ID] + ":" + [RC_CLIENT_SECRET]
var headers = {
       'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
       'Accept': 'application/json',
       'Authorization': 'Basic ' + Buffer.from(basic).toString('base64')
    }
var body = querystring.stringify({
             'grant_type' : 'refresh_token',
             'refresh_token' : 'REFRESH_TOKEN'
           })
var options = {host: url, path: endpoint, method: 'POST', headers: headers}

// Make an HTTPS POST request with the params above
1 Like 1 ·
Kiran Sutar avatar image Kiran Sutar Phong Vu ♦♦ commented ·

@Phong Vu Thank You for solution

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