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
Password Authentication error OAU - 149
Tags: authentication
Jan 24, 2020 at 9:55am   •   4 replies  •  0 likes
Adrienne Giles

I am using Java and trying to retrieve Call Log Records. trying to get a token for the call

https://platform.devtest.ringcentral.com/restapi/v1.0/account/@account/extension/@extension/message-store

Unirest.post(AuthURL);

rs.header("accept", "application/json");

rs.header("Content-Type", "application/x-www-form-urlencoded");

rs.header("Authorization", "Basic "+ClientId+ClientSecret );

parameters :

Map<String,Object> m = new HashMap<String,Object>();

m.put("grant_type", "password");

m.put("username", xxxxxx);

m.put("extension", "xxx");

m.put("password", xxxxxx);


when executed get { "errorCode" : "TokenInvalid", "message" : "Invalid token", "errors" : [ { "errorCode" : "OAU-149", "message" : "Invalid token" } ] }



Can anyone tell me the correct syntext to use for the authorization?

application https://platform.devtest.ringcentral.com/

settings as above. using the "try it" apps all works .

4 Answers
answered on Jan 27, 2020 at 7:48am  

Is there any reason why you cannot use the official RingCentral Java SDK. It would save you lots of time.

See this dev guide on how to work with the message store.


 0
answered on Jan 26, 2020 at 4:33am  

 0
answered on Jan 24, 2020 at 12:00pm  

Since you are using password flow. the API to get the token is as follows:

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

Header:

Content-Type: application/x-www-form-urlencoded

Authorization: Basic <Base64 of clientid:client secret>

Body parameter :

username=<user name>&password=<password>&extension=<extension>&grant_type=password

Please note: Here in the header Authorization will be Base64 encoding of clientid:client secret

rs.header("Authorization", "Basic "+Base64 of ClientId+":"+ ClientSecret ); 



 0
answered on Jan 26, 2020 at 4:31am  

Please refer the below screen shot.


 0



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