Question

Where do I put the access_token when calling a RingOut API?

  • 23 August 2020
  • 1 reply
  • 1058 views

I am using Password Flow to obtain an access token. This API call works. I can get a token. Now I need to call a RingOut. I have used all the same credentials (user name, password) as the API call to get a token, however I keep getting the response : "Invalid Authorization header":

I suspect this is because I am not including the access token in the URL, header, or params.

If you could give me an answer with respect to Postman, then I could translate that to my "real" app which is built in Lazarus.

Note: The phrase <redacted> is text that may contain sensitive information that has been removed

Note: "callerId" and "from" I assume is the same phone number... which is my dev sandbox account ?


So my question is: Where in Postman do I put the access token in the RingOut API call (URL, header, or params)?


Sent:

POST /restapi/v1.0/account/<redacted>/extension/101/ring-out HTTP/1.1

Content-Type: application/json

Content-Length: 412

Host: platform.devtest.ringcentral.com

Accept: application/json

User-Agent: Mozilla/3.0 (compatible; Indy Library)

Authorization: Basic <redacted>

from=<redacted>&to=<redacted>&callerId=<redacted>&country=Canada&playPrompt=true

Rcvd:

HTTP/1.1 401 Unauthorized

Server: nginx

Date: Sun, 23 Aug 2020 19:11:19 GMT

Content-Type: application/json

Content-Length: 175

Connection: keep-alive

WWW-Authenticate: Bearer realm="RingCentral REST API"

RCRequestId: 6d08a760-e574-11ea-b010-005056bb81b6


{

"errorCode" : "AGW-402",

"message" : "Invalid Authorization header",

"errors" : [ {

"errorCode" : "AGW-402",

"message" : "Invalid Authorization header"

} ]

}



1 reply

Authorization : Bearer <access_token>

Authorization will be Bearer when using generated access token. You have used Basic which is wrong

Reply