question

ahmer a avatar image
ahmer a asked ·

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.

authentication
1 |1000 characters needed characters left characters exceeded

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 ·

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 Share
1 |1000 characters needed characters left characters exceeded

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

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

0 Likes 0 · ·

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 · ·

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

0 Likes 0 · ·

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

0 Likes 0 · ·
Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary 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

Share
1 |1000 characters needed characters left characters exceeded

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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