question

Red Cypress avatar image
Red Cypress asked Phong Vu commented

Sandbox Get Token Failing

I have a new app (new everything). It's private, and server only ui so the Authorization Flow is "Password". I've calculated my Base64 for my key:secret, and submit the following using SOAPUI (Curl-like tool):

POST https://platform.devtest.ringcentral.com/restapi/oauth/token?grant_type=password&username=%2B12224447777&password=ddddddR79%2FaF&extension=101 HTTP/1.1
Accept-Encoding: gzip,deflate
MIME-Version: 1.0
Authorization: Basic <redacted base64 code>
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Content-Length: 43
Host: platform.devtest.ringcentral.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

I'm getting a response that says:

{
"error": "invalid_grant",
"errors": [ {
"errorCode": "OAU-140",
"message": "Invalid resource owner credentials"
}],
"error_description": "Invalid resource owner credentials"
}


I'm unclear on which of my credentials is incorrect. I've checked them all...so I'm not sure where to go next?

getting started
2 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.

Phong Vu avatar image Phong Vu ♦♦ commented ·

What is your app client id?

0 Likes 0 ·
Red Cypress avatar image Red Cypress Phong Vu ♦♦ commented ·

BFvgWbxmRsCscK1fADlZIw

0 Likes 0 ·
Phong Vu avatar image
Phong Vu answered
1 |3000

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

Red Cypress avatar image
Red Cypress answered

@Phong Vu As I said in my post, I'm using a curl-like tool called SOAP to test the interface. Once I see that working, I will then implement in code. It helps me isolate code problems from interface problems.

I don't use an SDK because you do not have one for Visual Basic.

Anyway for me to find out why it's failing if my app looks ok?

1 |3000

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

Red Cypress avatar image
Red Cypress answered Phong Vu commented

I finally got it working in my tool SOAPUI. I had to put the query parameters in the message body instead of the usual place on the URL. This is for anyone struggling with this.

You guys might want to add that little requirement in your docs. Unless it's there, and I missed it?

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.

Phong Vu avatar image Phong Vu ♦♦ commented ·

Yes we have that information in the API reference. Also in my tutorial code, it show the post body:

var headers = {
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'Accept': 'application/json',
    'Authorization': 'Basic ' + Buffer.from(basic).toString('base64')
   };
var body = querystring.stringify({
    'grant_type' : 'password',
    'username' : encodeURIComponent(process.env.RC_USERNAME),
    'password' : process.env.RC_PASSWORD
   });

Can you use the .Net SDK in VB.Net?

0 Likes 0 ·

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