Description
Hello. After authentication I am getting a code that’s attached to the redirect URL, then I am making a post request to the server with this code in the request body where I am trying to get an access token
Error
{“error”:{“message”:“Request failed with status code 400”,“name”:“Error”,“stack”:“Error: Request failed with status code 400\n at createError (/workspace/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/workspace/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/workspace/node_modules/axios/lib/adapters/http.js:236:11)\n at IncomingMessage.emit (events.js:412:35)\n at endReadableNT (internal/streams/readable.js:1317:12)\n at processTicksAndRejections (internal/process/task_queues.js:82:21)”,“config”:{“url”:“https://zoom.us/oauth/token?code=xxxxxxxxxxxxxxxxxxxxxxx&grant_type=authorization_code&redirect_uri=https://app.butternbinge.com/trending",“method”:“post”,“data”:null,“headers”:{“Accept”:"application/json, text/plain, /”,“Content-Type”:“application/x-www-form-urlencoded”,“Authorization”:“Basic xxxxxxxxxxxxxxxx”,“User-Agent”:“axios/0.19.2”},“transformRequest”:[null],“transformResponse”:[null],“timeout”:0,“xsrfCookieName”:“XSRF-TOKEN”,“xsrfHeaderName”:“X-XSRF-TOKEN”,“maxContentLength”:-1}}}
Which App Type (OAuth / Chatbot / JWT / Webhook)?
OAuth
Which Endpoint/s?
https://zoom.us/oauth/token?code=${req.body.code}&grant_type=authorization_code&redirect_uri=https://app.butternbinge.com/trending
How To Reproduce (If applicable)
Steps to reproduce the behavior:
Here’s the code I am using
const zoomRes = await axios.post(
`https://zoom.us/oauth/token?code=${req.body.code}&grant_type=authorization_code&redirect_uri=https://app.butternbinge.com/trending`,
null, {
headers: {
'Authorization': `Basic ${Buffer.from('ClientId' + ":" + 'ClientSecret')
.toString("base64")}`,
'Content-Type': 'application/x-www-form-urlencoded',
}
})
Additional context
I’ve tried modifying the request by changing the Content-Type to ‘application/json’ and the redirect URL to the one generated from the console. While I was experimenting, I only got 400 and 403 errors.