question

ahmer a avatar image
ahmer a asked Anirban answered

How to authenticate with REST API

I went through all the auth mechanisms and selected password authentication for my basic usage. But it can't seem to work although i have tried my best.

on this page, https://developers.ringcentral.com/guide/authentication/password-flow, it is noted:

Accept: application/json 
Content-Type: application/x-www-form-urlencoded 
Authorization: Basic cmVsLWFsbC1wZXJtaXNzaWXFjMmpRZmlQcnlkSUkweE92QQ==
grant_type=password&username=18559100010&extension=101&password=121212  

Can anyone explain are these request headers or request parameters? I'm myself confused and documentation pages seem to be scattered? Is the value in Authorization key is base64 encoded clientid and client secret or the username password combination? Any help would be appreciated.

rest api
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered Phong Vu commented

See these tutorials. Choose a language you are familiar with

https://developers.ringcentral.com/tutorials.html

Choose the Password Flow topic and select one of the tutorial from the "Access RingCentral platform services using native APIs" group.


4 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.

ahmer a avatar image ahmer a commented ·

i want to do it in vanilla python and not using python SDK

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ ahmer a commented ·

It is not an SDK. The tutorial ""Access RingCentral platform services using native APIs" is about using native http lib to send GET and POST request.

0 Likes 0 ·
ahmer a avatar image ahmer a commented ·

Accept, content-type, Authorization seem to be request header and the last line seems to be request parameter? is it so?

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ ahmer a commented ·

You still did not look at the tutorial. Last line in your case is the body of a POST request.

0 Likes 0 ·
Anirban avatar image
Anirban answered

"Can anyone explain are these request headers or request parameters? I'm myself confused and documentation pages seem to be scattered? Is the value in Authorization key is base64 encoded clientid and client secret or the username password combination? "


Header:

Authorization header is Base64 format of clientId and client secret separated with ' : ' as follow:

                 
  1. Authorization Basic <clientId:clientSecret in Base64>

Content-Type: application/x-www-form-urlencoded

url: https://platform.devtest.ringcentral.com/restapi/oauth/token

Body parameter :

username=<user name>&password=<password>&extension=<extension>&grant_type=password

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

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