question

ATT OFFICE AT HAND BILLING avatar image
ATT OFFICE AT HAND BILLING asked Carson Beier answered

oauth/token endpoint says my client id is invalid, but it matches exactly what I have in console

Endpoint: https://platform.ringcentral.com/restapi/oauth/token


When I call this endpoint, I get the following error:

{
	"error": "invalid_client",
	"error_description": "Invalid client: {
  {my_client_id}}",
	"errors": [
		{
			"errorCode": "OAU-153",
			"message": "Invalid client: {
  {my_client_id}}",
			"parameters": [
				{
					"parameterName": "client_id",
					"parameterValue": "{
  {my_client_id}}"
				}
			]
		}
	]
}

When I switch back to using the sandbox environment endpoint (https://platform.devtest.ringcentral.com/restapi/oauth/token) everything works perfectly.

I know I have different credentials for both the production and sandbox environments.

I took my Client ID & Client Secret for my Production Environment and base64 encoded them in the format { {client_id}}:{ {client_secret}} from https://www.base64decode.org.

These are the same exact steps that worked successfully for me in the sandbox environment but it says my client id is invalid in production... I did a string comparison for the { {my_client_id}} value returned in the error response above and compared it to my Production Environment Client ID in the web console and they match exactly, so I am not sure what to do at this point.

I thought that it was maybe because I am trying to access this production environment endpoint shortly after graduating my app to production, but after a few hours, it still does not work.

authentication
1 |3000

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

ATT OFFICE AT HAND BILLING avatar image
ATT OFFICE AT HAND BILLING answered ATT OFFICE AT HAND BILLING edited

The issue is that I should be using https://platform.ringcentral.biz as the url to call, not https://platform.ringcentral.com (which is what is listed in my developer console).


This answer came as a result of a tech support session with RingCentral engineers, and several days worth of them troubleshooting the issue. I did not find this answer, or any reference to this URL, anywhere in this forum.


Hope this can help others avoid some headaches when moving their app to production.

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 answered

Can you confirm if you login the production environment with:

1. Client id and client secret for the production environment

2. User name and password of a user under the production account (not the same as the user under the sandbox)

3. The server url is https://platform.ringcentral.com

If all the login credentials are correct and you still get the same error message, please post just the client id here so I can help to check your app.

1 |3000

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

ATT OFFICE AT HAND BILLING avatar image
ATT OFFICE AT HAND BILLING answered ATT OFFICE AT HAND BILLING edited

My production client ID is: VHRj3VEQTneWtcbGw9obMw


I login with my email and password(not a phone number if that makes a difference) and my username/password for production is the same as my sandbox credentials.


I receive a 404 error for the link you provided when I try to open it in my browser, however I am able to login to the admin portal with the exact same username/password as my developer account.


Also, if I change my user credentials to be incorrect, I receive the error "Invalid resource owner credentials", so it seems like it is getting past my user credentials and failing when it checks my client id.

1 |3000

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

Anirban avatar image
Anirban answered

Since the solution you mentioned is no where documented and most of the user is also not aware about the url format you mentioned in the solution, request ringCentral team to justify the solution and document somewhere so that it can be referred in future.

1 |3000

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

Carson Beier avatar image
Carson Beier answered

I have a similar problem, but only in my sandbox environment. Can someone confirm the API Server URL is: https://platform.devtest.ringcentral.com

I am also receiving this response: OAU-153 Invalid client: ZQKpuJrXQ82jGxt0_4w-4A

And this client reported is exactly the same one as in my sandbox console. In the past I would only get this error if the client ID was incorrect OR the API server URL is incorrect. But I have copy - pasted them from the console.

What do I check now?

1 |3000

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