# Generate a new access token getting Bad Request 400 error

**URL:** <https://devforum.zoom.us/t/generate-a-new-access-token-getting-bad-request-400-error/101272>\
**Category:** API and Webhooks\
**Created:** [January 5, 2024, 11:33am UTC](https://devforum.zoom.us/t/generate-a-new-access-token-getting-bad-request-400-error/101272 "2024-01-05T11:33:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![javed](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@javed](https://devforum.zoom.us/u/javed)\
**Post date:** [January 5, 2024, 11:33am UTC](https://devforum.zoom.us/t/generate-a-new-access-token-getting-bad-request-400-error/101272/1 "2024-01-05T11:33:25Z")

</div>

Getting the 400 bad request on the generate token.

curl --location --request POST ‘[https://zoom.us/oauth/token?grant\_type=account\_credentials&account\_id=1XivB0\_R-OJP8qg](https://zoom.us/oauth/token?grant_type=account_credentials&account_id=1XivB0_R-OJP8qg)’ \

–header ‘Authorization: Basic Vmo2TlZCZkhScFdPbDk0aUpFbEZPUTo2SFlkNjJlSzBHTG’ \

–data ‘’

---

<div class="post-metadata">

**Author:** ![khantufail425](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/khantufail425/32/55446_2.png) [@khantufail425](https://devforum.zoom.us/u/khantufail425)\
**Post date:** [January 5, 2024, 7:44pm UTC](https://devforum.zoom.us/t/generate-a-new-access-token-getting-bad-request-400-error/101272/2 "2024-01-05T19:44:53Z")

</div>

Getting the same with the following payload  
code: [code]  
grant\_type: authorization\_code

```auto
{
    "reason": "Invalid authorization code",
    "error": "invalid_grant"
}

```

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [January 6, 2024, 3:38am UTC](https://devforum.zoom.us/t/generate-a-new-access-token-getting-bad-request-400-error/101272/3 "2024-01-06T03:38:05Z")

</div>

Hi @khantufail425 @javed ,

Which app type are you using?

---

<div class="post-metadata">

**Author:** ![khantufail425](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/khantufail425/32/55446_2.png) [@khantufail425](https://devforum.zoom.us/u/khantufail425)\
**Post date:** [January 6, 2024, 12:20pm UTC](https://devforum.zoom.us/t/generate-a-new-access-token-getting-bad-request-400-error/101272/5 "2024-01-06T12:20:04Z")

</div>

@gianni.zoom I’m trying to create the meeting via API, that’s why I need this token didn’t mention any app type there.

---

<div class="post-metadata">

**Author:** ![javed](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@javed](https://devforum.zoom.us/u/javed)\
**Post date:** [January 6, 2024, 12:25pm UTC](https://devforum.zoom.us/t/generate-a-new-access-token-getting-bad-request-400-error/101272/6 "2024-01-06T12:25:12Z")

</div>

I got this by calling with the below deatils

[https://zoom.us/oauth/token?grant\_type=account\_credentials&account\_id={account\_id}](https://zoom.us/oauth/token?grant_type=account_credentials&account_id=%7Baccount_id%7D)

account\_id - get from Server-to-Server OAuth type app.

and Passing Client ID and Client Secret in the Basic Auth.

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [January 7, 2024, 6:24am UTC](https://devforum.zoom.us/t/generate-a-new-access-token-getting-bad-request-400-error/101272/7 "2024-01-07T06:24:07Z")

</div>

@khantufail425 you need to create an OAuth or other app-type to gain credentials for authorized use use of Zoom API. Please see the docs for the different app types and how to create: [Create an OAuth app](https://developers.zoom.us/docs/integrations/create/)

@javed , please see this troubleshooting guide for help with your error: [Troubleshooting Server-to-Server Oauth access tokens](https://developers.zoom.us/blog/s2s-token-generation-troubleshoot/)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [January 9, 2025, 10:00pm UTC](https://devforum.zoom.us/t/generate-a-new-access-token-getting-bad-request-400-error/101272/8 "2025-01-09T22:00:21Z")

</div>

Closed on January 9, 2025, 10:00pm UTC

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.
