question

Victor Reynolds avatar image
Victor Reynolds asked Victor Reynolds commented

503 Service Temporarily Unavailable with my oauth key curl,I get a 503 error trying to get the oauth token

For the whole day (July 16 2021) every time I run the command in curl to get the oauth token, I get a 503 Service Temporarily Unavailable error.

Even when I try to just copy and paste the url http://service.devtest.ringcentral.com/restapi/oauth/token in my browser, I get the error.

Is anyone else having this issue? If not, what am I dong wrong?

Im using this command:

curl -i -X POST "https://platform.devtest.ringcentral.com/restapi/oauth/token"; \
-H "Accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-u "<my app key info>:<my secret info>" \
-d "devPhoneNum&password=secretPassword&extension=101&grant_type=password"
oauth
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 Victor Reynolds commented

It is completely wrong on these 2 lines

-u "<my app key info>:<my secret info>" \
-d "devPhoneNum&password=secretPassword&extension=101&grant_type=password"

Look at the example

POST https://platform.devtest.ringcentral.com/restapi/oauth/token
Accept: application/json 
Content-Type: application/x-www-form-urlencoded 
Authorization: Basic cmVsLWFsbC1wZXJtaXNzaWXFjMmpRZmlQcnlkSUkweE92QQ==
grant_type=password&username=18559100010&extension=101&password=121212

https://developers.ringcentral.com/guide/authentication/password-flow

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

Victor Reynolds avatar image Victor Reynolds commented ·

the examples I followed the docs and what Ive seen from here in the forums. In fact, I copy and pasted the curl command from a few forum posts, and its how I started to get the 503 error.

Right now, I'm not sure where Im going wrong. I think I'm supplying the mandatory params via CURL, but obviously something is not right.


0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Victor Reynolds commented ·

What docs did you follow? What example shows you the highlighted params below?

-u "<my app key info>:<my secret info>" \
-d "devPhoneNum&password=secretPassword&extension=101&grant_type=password"
1 Like 1 ·
Victor Reynolds avatar image Victor Reynolds Phong Vu ♦♦ commented ·

that example came from the forums. The docs dont have a curl example to follow

0 Likes 0 ·
Show more comments
Anirban avatar image
Anirban answered Victor Reynolds commented

There are so many threads available on this topic in the community with examples and commands.

Example : https://community.ringcentral.com/questions/884/curl-restapioauthtoken-errorcode-oau-251-message-u.html

1 comment
1 |3000

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

Victor Reynolds avatar image Victor Reynolds commented ·

I've seen those examples, and how I got my curl command to use. my results are different and Im not sure why. What do you see that Im missing, because I copy and pasted the curl commands others used and Im not getting the same results.

My settings now has the green check mark for "passwords" but auth codes has a red X.
Maybe I need to make a new app and try again? OR maybe Im using the wrong stuff for the settings in my app?

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