Description
Hello everyone,
we have an integration with the Zoom meetings API which uses the account_credentials grant type to get an Access Toke via a Server-to-Server app in order to use the Meetings API to create/update meetings etc.
Error?
We recently started getting 400 Bad Request response to /oauth/token:
400 Client Error: Bad Request for url: https://zoom.us/oauth/token?grant_type=account_credentials&account_id=[REDACTED]
Further details
Our code sends the grant_type and account_id params in the query string of the POST request to the /oauth/token (the code was written a few years ago).
A quick check of the docs reveals we should be
putting the params in the request body
set the Content-Type header as application/x-www-form-urlencoded
I checked the changelog and couldn’t see recent changes about the /token endpoint.
Has this recently changed? Or was the query string params an undocumented feature that has recently been tightened?
I see you’re facing an issue with Zoom’s Meetings API integration using the account_credentials grant type for obtaining an Access Token via a Server-to-Server app.
The Problem
You’re encountering a 400 Bad Request error when making a request to the /oauth/token endpoint:
400 Client Error: Bad Request for url: https://zoom.us/oauth/token?grant_type=account_credentials&account_id=[REDACTED]
This happens if your code sends the grant_type and account_id parameters in the query string of the POST request. The correct method is to:
Send the parameters in the request body
Set the Content-Type header to application/x-www-form-urlencoded
Solution
Here’s a working NodeJS implementation to fix the issue: