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

**URL:** <https://devforum.zoom.us/t/client-error-post-https-zoom-us-oauth-token-resulted-in-a-400-bad-request-response-reason-invalid-token-error-invalid-grant/119971>\
**Category:** API and Webhooks\
**Tags:** api\
**Created:** [October 29, 2024, 3:20am UTC](https://devforum.zoom.us/t/client-error-post-https-zoom-us-oauth-token-resulted-in-a-400-bad-request-response-reason-invalid-token-error-invalid-grant/119971 "2024-10-29T03:20:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coco](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@coco](https://devforum.zoom.us/u/coco)\
**Post date:** [October 29, 2024, 3:20am UTC](https://devforum.zoom.us/t/client-error-post-https-zoom-us-oauth-token-resulted-in-a-400-bad-request-response-reason-invalid-token-error-invalid-grant/119971/1 "2024-10-29T03:20:54Z")

</div>

When trying to obtain an access token at [https://zoom.us/oauth/token](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.

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [October 29, 2024, 2:59pm UTC](https://devforum.zoom.us/t/client-error-post-https-zoom-us-oauth-token-resulted-in-a-400-bad-request-response-reason-invalid-token-error-invalid-grant/119971/2 "2024-10-29T14:59:02Z")

</div>

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

> **[OAuth for user authorized apps - Zoom Developers](https://developers.zoom.us/docs/integrations/oauth/#using-an-access-token)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

---

<div class="post-metadata">

**Author:** ![coco](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@coco](https://devforum.zoom.us/u/coco)\
**Post date:** [October 31, 2024, 1:33am UTC](https://devforum.zoom.us/t/client-error-post-https-zoom-us-oauth-token-resulted-in-a-400-bad-request-response-reason-invalid-token-error-invalid-grant/119971/4 "2024-10-31T01:33:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [November 26, 2024, 12:17am UTC](https://devforum.zoom.us/t/client-error-post-https-zoom-us-oauth-token-resulted-in-a-400-bad-request-response-reason-invalid-token-error-invalid-grant/119971/5 "2024-11-26T00:17:33Z")

</div>

Hi @coco  
Sorry for the late reply here!  
Have you been able to troubleshoot this on your end?
