Not getting JSON response body from POST request to https://zoom.us/oauth/token

Description
During the OAuth 2 flow (Step 2), I am unexpectedly not getting a json response wheh making a POST request to https://zoom.us/oauth/token. I am writing Python and this is my code:

import requests

import json

URL = ‘https://zoom.us/oauth/token?grant_type=authorization_code&code=AUTHORIZATIONCODE&redirect_uri=REDIRECTURI
clientParams= “Basic CLIENT_ID:CLIENT_SECRET”
r = requests.post(URL, headers = {‘authorization’:clientParams})
r.json()

Error
Once the r.json() line executes, the program fails because the response body from the post request isn’t in JSON

Which App Type (OAuth / Chatbot / JWT / Webhook)?
OAuth

Hey @jasonb,

What is the response body from Zoom?

Thanks,
Tommy

@tommy here is the beginning of the r.text output

<!doctype html>
<html xmlns:fb="http://ogp.me/ns/fb#" lang="en-US" >
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# zoomvideocall: http://ogp.me/ns/fb/zoomvideocall#">
<title>Error - Zoom</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0">
<meta name="google-site-verification" content="8WU-FkemSTzA1EpoynHUDYe2UxPXiMS53FBXk6_qVy4" />
<meta name="google-site-verification" content="J_tzcwoKXfPkhsWbiS7cM6WEn3pjCr_DhMNmhRtd960" />
<meta name="google-site-verification" content="o7_kGQ-oKZjWTkzWK3NYR9JUf3SvQKIBwjHgqTE_FHU" />
<meta name="google-site-verification" content="QXsuSwndXLLWh52gEd4ig7alEmTyDp0NPo4GCKsUH5k" />
<meta name="google-site-verification" content="Vt60qsrxhpi8GdAMlhQod8oxA2LAtN908SnMDdelCYc" />
<meta name="google-site-verification" content="v3_Ow9RbJsRZ9MLl--QrhABeFcA9oP7OBXhY50O4QuA" />
<meta name="google-site-verification" content="0fZHb1ni-k_iNiYVnomwmnY9ITBunxqU8VC49mHDNxc" />
<meta name="keywords" content="zoom, zoom.us, video conferencing, video conference, online meetings, web meeting, video meeting, cloud meeting, cloud video, group video call, group video chat, screen share, application share, mobility, mobile collaboration, desktop share, video collaboration, group messaging" />
<meta name="robots" content="noindex,nofollow" />
<meta name="description" content="Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars across mobile, desktop, and room systems. Zoom Rooms is the original software-based conference room solution used around the world in board, conference, huddle, and training rooms, as well as executive offices and classrooms. Founded in 2011, Zoom helps businesses and organizations bring their teams together in a frictionless environment to get more done. Zoom is a publicly traded company headquartered in San Jose, CA." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://zoom.us/" />
<meta property="og:title" content="Video Conferencing, Web Conferencing, Webinars, Screen Sharing" />
<meta property="og:description" content="Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars across mobile, desktop, and room systems. Zoom Rooms is the original software-based conference room solution used around the world in board, conference, huddle, and training rooms, as well as executive offices and classrooms. Founded in 2011, Zoom helps businesses and organizations bring their teams together in a frictionless environment to get more done. Zoom is a publicly traded company headquartered in San Jose, CA." />
<meta property="og:image" content="https://d24cgw3uvb9a9h.cloudfront.net/static/94034/image/thumb.png" />
<meta property="og:site_name" content="Zoom Video" />
<meta property="fb:app_id" content="113289095462482" />
<meta property="twitter:account_id" content="522701657" />
<link rel="shortcut icon" href="https://d24cgw3uvb9a9h.cloudfront.net/zoom.ico" />
<link rel="canonical" href="https://zoom.us/error" />
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/kgjfgplpablkjnlkjmjdecgdpfankdle" />
<script type="text/javascript">
var resourceAccountIdRoutingURl = "t_x_zm_aid=LwuIV_Q5R3uAgj08OXnAkA&t_x_zm_haid=954";
resourceAccountIdRoutingURl = resourceAccountIdRoutingURl==""?undefined:resourceAccountIdRoutingURl;
</script>
<link type="text/css" rel="stylesheet" href="https://d24cgw3uvb9a9h.cloudfront.net/static/94034/css/all.min.css" />
<style>
body div.combobox div.dropdownlist{
width: calc(100% + 2px) !important;
}
</style>
<script src="/csrf_js?t_x_zm_aid=LwuIV_Q5R3uAgj08OXnAkA&t_x_zm_haid=954"></script>
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'country': 'us'

Hey @jasonb,

Make sure you are base64 encoding the Client_id:Client_secret.

-Tommy

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