News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
503 Service Temporarily Unavailable with my oauth key curl,I get a 503 error trying to get the oauth token
Tags: oauth
Jul 16, 2021 at 4:52pm   •   2 replies  •  0 likes
Victor Reynolds

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"
2 Answers
answered on Jul 17, 2021 at 7:55am  

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


 1
on Jul 18, 2021 at 6:51am   •  0 likes

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.


on Jul 18, 2021 at 10:32am   •  1 likes

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"
on Jul 19, 2021 at 1:08pm   •  0 likes

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

on Jul 19, 2021 at 1:26pm   •  1 likes

It doesn't matter anymore. You need to change the parameters as shown in my answer!

on Jul 19, 2021 at 2:27pm   •  0 likes

what is this string in your example:

cmVsLWFsbC1wZXJtaXNzaWXFjMmpRZmlQcnlkSUkweE92QQ==


on Jul 19, 2021 at 2:30pm   •  1 likes

based64 encoded string of your "app_client_id:app_client_secret"

on Jul 19, 2021 at 2:51pm   •  0 likes

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?

on Jul 19, 2021 at 3:30pm   •  1 likes

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.

on Jul 20, 2021 at 7:31am   •  0 likes

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

on Jul 20, 2021 at 8:15am   •  1 likes

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" 
on Jul 20, 2021 at 9:27am   •  0 likes

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.

on Jul 20, 2021 at 9:30am   •  1 likes

Why "http://service.devtest./"?

Do you ever read carefully what I posted?

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

on Jul 20, 2021 at 10:20am   •  1 likes

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


answered on Jul 17, 2021 at 12:09pm  

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
on Jul 18, 2021 at 6:55am   •  0 likes

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

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us