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"
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
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.
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"
that example came from the forums. The docs dont have a curl example to follow
It doesn't matter anymore. You need to change the parameters as shown in my answer!
what is this string in your example:
cmVsLWFsbC1wZXJtaXNzaWXFjMmpRZmlQcnlkSUkweE92QQ==
based64 encoded string of your "app_client_id:app_client_secret"
First off, I really appreciate your patience with me on this matter. Thank you for taking your time to offer some help.
With that said, I'm not sure what I'm doing wrong, but I encoded my app client: app secret info and have this curl command:
curl -X POST "http://service.devtest.ringcentral.com/restapi/oauth/token"; -H "Accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -u "Authorization: Basic MEI2aEpDX2NTdVdhTTVUT1VfRExZUTo3aFpSNkFtcFJjU2tISFcybi13aUN3WHpQcjFobXpTd2lfdxxxx" -d "grant_type=password&username=+1470502XXXX&password=<password>&extension=101"
But I still get the 503 error. Maybe I need to make a new app with different settings?
Encode the plus sign in your username %2B1470502xxx
BTW, you should not post entire phone number and the basic encode string here in public place. I edited your post to hind them this time.
thanks for the heads up about security.
I encoded the username, and i still get the same 503 error. The type of app I created was for the "other none UI (e.g cron job, daemon, command line) so I believe I have the right app type set up.
At this point, I dont know whats going on...
Just double check your curl and found that you use the -u option. Why proxy?
Change it to -H as it is the header
-H "Authorization: Basic MEI2aEpDX2NTdVdhTTVUT1VfRExZUTo3aFpSNkFtcFJjU2tISFcybi13aUN3WHpQcjFobXpTd2lfdxxxx"
unfortunately, i still get the same results. I dont get why the error I get is "service temporarily unavailable" instead of a specific error that will help me understand where Im going wrong.
this is the cur command Im using:
curl -X POST "http://service.devtest.ringcentral.com/restapi/oauth/token" -H "Accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic MEI2aEpDX2NTdVdhTTVUT1VfRExZUTo3aFpSNkFtcFJjU2tISFcybi13aUN3WHpQcjFobXpTd2lfdHlXejNTxxxxxxxx" -d "grant_type=password&username=%2B14705020292&password=<password>&extension=101"
I also sent all the grant type as a header too, no change at all.
Why "http://service.devtest./"?
Do you ever read carefully what I posted?
POST https://platform.devtest.ringcentral.com/restapi/oauth/token
oh, my mistake. I have a text file with your suggestions and the different curl commands I tried. I was editing the wrong command today...Thats embarrassing.
Anyway, I got an auth code now. I really appreciate you putting up with my careless error and helping me through this
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
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?
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder