question

brimestone1479 avatar image
brimestone1479 asked brimestone1479 answered

Sandbox happy, now porting to Production..

I been playing around the API for sometime now and I'm happy with what i got.


Now, I'm trying to port to the production server but right away, I'm having problem trying to login.


I'm using Advance REST client and the Authentication modal dialog doesn't go away. (keeps failing. I keep getting the following.


{


"error": "invalid_client"

"error_description": "Access Denied."

}


I tried again with my Sandbox credential and it works fine.


I've double check the URL for both server and double check the endpoints but to no avail.


Please help.


Thanks.


developer sandbox
1 |1500 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.

ak avatar image
ak answered
Hi Ted,

Could you use the AppKey and AppSecret issued against your Production Environment.

Find your application key and secret by Navigating to My Account -> Applications -> Application Name. Use Production Application key and secret.

Let us know if you are able to authenticate.

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

brimestone1479 avatar image
brimestone1479 answered
I did.. that is one of the things i have to re-encode for the production server.

I just confirmed the base64 hash of the keys just now.
1 |1500 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.

benjamin-dean avatar image
benjamin-dean answered
And your application has applied for and been approved for production access? If you're not sure, visit the Developer Portal and view the "Credentials" section for your application. The API server, app_key, and app_secret are different for production environment, and you must apply to be granted this access.

Are you making sure the username is prefixed with the country code prefix, so for instance if I am in the USA the country code is "1" and the username would be "14445559999"?

Are you using the extension property? If you are and it doesn't match the username you're providing, then I get an invalid_client sometimes.

Are there any spaces before or after your username, extension, or password?

Is the Content-Type header property set to "application/x-www-form-urlencoded"?

Is the Accept header property set to "application/json"?
1 |1500 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.

brimestone1479 avatar image
brimestone1479 answered
Yes, the application has been approved. Will try it again today (with a fresh set of eyes).

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

benjamin-dean avatar image
benjamin-dean answered
Awesome! Keep us posted on your progress and let us know if you have any more questions.
1 |1500 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.

brimestone1479 avatar image
brimestone1479 answered
I tried. Still get this error.

{
"error": "invalid_grant"
"error_description": "Invalid resource owner credentials."
}

I ignored what i have in the sandbox and followed this guide.

https://developer.ringcentral.com/library/tutorials/get-started.html
1 |1500 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.

benjamin-dean avatar image
benjamin-dean answered
Could you please provide the complete oauth POST request you're sending (please remove your API keys: app_key and app_secret).
1 |1500 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.

brimestone1479 avatar image
brimestone1479 answered
How would i do that? I'm using Advanced REST client
1 |1500 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.

brimestone1479 avatar image
brimestone1479 answered
Figured out the issue.

It has something to with a character in my password.
The offending Character was "+"
1 |1500 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.

brimestone1479 avatar image
brimestone1479 answered
Ok, i got the Authentication part down. Yipee! 

Now, I'm getting error when i try to send an SMS

{
                 
  ["errorCode"]=>   string(16) "InvalidParameter"   ["message"]=>   string(47) "Resource for parameter [accountId] is not found"   ["errors"]=>   array(1) {     [0]=>     object(stdClass)#3 (3) {       ["errorCode"]=>       string(7) "CMN-102"       ["message"]=>       string(47) "Resource for parameter [accountId] is not found"       ["parameterName"]=>       string(9) "accountId"     }   }   ["parameterName"]=>   string(9) "accountId" } 

i got [accountId] from  [owner_id] here.
Authentication/Token
{   ["access_token"]=>   string(234) "<changed>"   ["token_type"]=>   string(6) "bearer"   ["expires_in"]=>   int(3599)   ["refresh_token"]=>   string(234) "<changed>"   ["refresh_token_expires_in"]=>   int(604799)   ["scope"]=>   string(62) "ReadPresence ReadMessages ReadCallLog SMS RingOut ReadAccounts"   ["owner_id"]=>   string(10) "2602536012"   ["endpoint_id"]=>   string(22) "_2rE1bLdSomqUlj-I4Xn4g" } 
1 |1500 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.

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