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

**URL:** <https://devforum.zoom.us/t/not-getting-json-response-body-from-post-request-to-https-zoom-us-oauth-token/26226>\
**Category:** API and Webhooks\
**Created:** [August 4, 2020, 3:10pm UTC](https://devforum.zoom.us/t/not-getting-json-response-body-from-post-request-to-https-zoom-us-oauth-token/26226 "2020-08-04T15:10:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonb](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jasonb/32/13019_2.png) [@jasonb](https://devforum.zoom.us/u/jasonb)\
**Post date:** [August 4, 2020, 3:10pm UTC](https://devforum.zoom.us/t/not-getting-json-response-body-from-post-request-to-https-zoom-us-oauth-token/26226/1 "2020-08-04T15:10:11Z")

</div>

**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](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](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

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [August 5, 2020, 9:10pm UTC](https://devforum.zoom.us/t/not-getting-json-response-body-from-post-request-to-https-zoom-us-oauth-token/26226/2 "2020-08-05T21:10:07Z")

</div>

Hey @jasonb,

What is the response body from Zoom?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![jasonb](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jasonb/32/13019_2.png) [@jasonb](https://devforum.zoom.us/u/jasonb)\
**Post date:** [August 6, 2020, 2:36pm UTC](https://devforum.zoom.us/t/not-getting-json-response-body-from-post-request-to-https-zoom-us-oauth-token/26226/6 "2020-08-06T14:36:54Z")

</div>

@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'
```

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [August 7, 2020, 7:45pm UTC](https://devforum.zoom.us/t/not-getting-json-response-body-from-post-request-to-https-zoom-us-oauth-token/26226/7 "2020-08-07T19:45:06Z")

</div>

Hey @jasonb,

Make sure you are base64 encoding the `Client_id:Client_secret`.

> [@Whe POSTing to https://zoom.us/oauth/token I get an HTML response back](https://devforum.zoom.us/t/whe-posting-to-https-zoom-us-oauth-token-i-get-an-html-response-back/25649):
>
> Description I am trying to exchange a “code” for an access\_token but when i post to [https://zoom.us/oauth/token?grant\_type=authorization\_code&code=](https://zoom.us/oauth/token?grant_type=authorization_code&code=){code the query param after user clicked authorize}&redirect\_uri={redirect uri defined in development app} Instead of getting a JSON response back I get an HTML page that looks like just a page on Zoom’s website Which App Type (OAuth / Chatbot / JWT / Webhook)? OAuth Which Endpoint/s? /oauth/token How To Reproduce (If applicable) Steps to repr…

-Tommy

---

<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:** [August 17, 2020, 7:45pm UTC](https://devforum.zoom.us/t/not-getting-json-response-body-from-post-request-to-https-zoom-us-oauth-token/26226/8 "2020-08-17T19:45:09Z")

</div>

Closed on August 17, 2020, 7:45pm UTC

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