Client error: post https://zoom.us/oauth/token resulted in a 400 bad request response: { reason : invalid token!, error : invalid_grant }

When trying to obtain an access token at https://zoom.us/oauth/token, the error in the title occurs.

oauth/token is written to be executed when the access token has expired, the refresh token is encrypted and stored in the DB, and the access token is stored in the cache with an expiration date.

Also, when executing other APIs such as meeting ID issuing API, it is included in the header in the form of “‘Authorization’ => 'Bearer '. $accessToken”.

There seemed to be no mistakes in the zoom user ID, etc.
We have confirmed that the same code is working correctly in a different environment.

Has anyone else experienced this or are there any recommended workarounds to deal with this error? Any help would be appreciated.

1 Like

Hi @coco
Thanks for reaching out to us!
Here is a link to our Docs on how to use an access token:

Thank you for your response.

Here is the approach I am currently taking in my code:

  1. If the access token has expired, retrieve a new token.
  2. Use the access token obtained in step 1 to make requests to the Zoom API (e.g., /users/{userId}/meetings).

I created the code based on the official documentation and confirmed that it works correctly in one environment. However, I am encountering the aforementioned error in a different environment. Since both environments use the same code, I believe there is no issue with the way requests are written.

If you have any ideas on potential causes or any additional items I should check, I would greatly appreciate your guidance.