question

tom avatar image
tom asked Phong Vu commented

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

tom avatar image tom commented ·

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

Phong Vu avatar image
Phong Vu answered Phong Vu commented

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
1 |3000

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

tom avatar image tom commented ·

@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 ·
Phong Vu avatar image Phong Vu ♦♦ tom commented ·

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 ♦♦ commented ·

@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

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