question

tom avatar image
tom asked ·

Outbound fax failed with OAU-140

Hello, I have setup my first app with 'private' and 'server only(no UI)' and tried to test sending a fax under sandbox env. The first request went out and put into queue, however when I try to retest the same request, it gave me an error. Please advise. Thanks.

==Error info

WWW-Authenticate: Bearer realm="RingCentral REST API", error="invalid_grant", error_description="Invalid resource owner credentials"

RCRequestId: bb6be21c-286b-11ea-9d35-005056bbcdd9

Pragma: no-cache

Cache-Control: no-store

AceRoutingKey: sjc11-c01-ace11.8e816ecd-0d3b-11ea-9962-005056bb6e9b

RoutingKey: SJC12P01


{

"error" : "invalid_grant",

"errors" : [ {

"errorCode" : "OAU-140",

"message" : "Invalid resource owner credentials"

} ],

"error_description" : "Invalid resource owner credentials"

}

== my setting

static String RINGCENTRAL_CLIENTID = "app cient id";

static String RINGCENTRAL_CLIENTSECRET = "app secret";


static String RINGCENTRAL_USERNAME = "sanbox number";

static String RINGCENTRAL_PASSWORD = "sandbox password";

static String RINGCENTRAL_EXTENSION = "101"; //from sandbox


public static final String SERVER = "https://platform.devtest.ringcentral.com";


fax test
1 comment
1 |1000 characters needed characters left characters exceeded

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

BTW, I am using an Java application to send the request. Below is more info I found from console:

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

Authorization: Basic SG5HQjlXWE1SQVNDcURNN3I5bEExQTpOZ2ZHQUZzZ1NZSzJDUTZmd0RjazZnaE4zSzJuYUNSdGliN1RKaHkwV2p1Zw==

X-User-Agent: RC-JAVA-SDK Java 1.8.0_191 Wind

0 Likes 0 · ·

1 Answer

· Write an Answer
Phong Vu avatar image
Phong Vu answered ·

There must be some mistake with your credentials somewhere. It is impossible if nothing changes and you could send once but not twice.

Please double check your code and follow the instructions from this dev guide and try again.

4 comments Share
1 |1000 characters needed characters left characters exceeded

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

@Phong Vu I just removed the old app and created a new one for the testing and got the same error. I copy/paste clientID, client secret, extension and username (sandbox number) directly from Sandbox Credentials section. The password is right too since I can login into https://service.devtest.ringcentral.com/ with the password and sanbox number that I put into the code. I tried both "+12055824829" and "12055824829" for the username and still get the same error. Can you check the logs on your end for my request? Thanks.



0 Likes 0 · ·

I have a look at your sandbox account and you have only 1 user, which is the super admin and the extension number is 33029. As you stated in your original question that you specify the extension number as 101 which is incorrect. It should be as shown below:

static String RINGCENTRAL_EXTENSION = "33029"; //from sandbox

Please try again and let me know.

0 Likes 0 · ·
tom avatar image tom Phong Vu ♦♦ ·

@Phong Vu oh, yes, it's working now. The strange thing is under console>app>sandbox setting, the extension is showing 101 but under service.devtest.ringcentral.com, it's showing 33029. Maybe there is a sync issue, but anyways, it's working. Thanks for help. Right now my API call is using basic Authorization. Next I want to try OAuth. Do you have any good example for Java API? I saw a request/response example under https://developers.ringcentral.com/guide/authentication/auth-code-flow . How would I use those token after receiving them? Maybe just add them in a header?

0 Likes 0 · ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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