# My Python code is not working to get the Meetings data

**URL:** <https://devforum.zoom.us/t/my-python-code-is-not-working-to-get-the-meetings-data/52117>\
**Category:** API and Webhooks\
**Created:** [June 9, 2021, 3:16pm UTC](https://devforum.zoom.us/t/my-python-code-is-not-working-to-get-the-meetings-data/52117 "2021-06-09T15:16:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammed\_zaid](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mohammed_zaid/32/27959_2.png) [@mohammed\_zaid](https://devforum.zoom.us/u/mohammed_zaid)\
**Post date:** [June 9, 2021, 3:16pm UTC](https://devforum.zoom.us/t/my-python-code-is-not-working-to-get-the-meetings-data/52117/1 "2021-06-09T15:16:14Z")

</div>

The following code is not working, it is suppose GET Meetings:

```auto
import jwt
import http.client
import datetime
import json

api_key = '.....'
api_sec = '.....'

payload = {
'iss': api_key,
'exp': datetime.datetime.now() + datetime.timedelta(hours=2)
}
jwt_encoded = str(jwt.encode(payload, api_sec), 'utf-8')

conn = http.client.HTTPSConnection("api.zoom.us")
headers = {
'authorization': "Bearer %s" % jwt_encoded,
'content-type': "application/json"
}
conn.request("GET", "/metrics/meetings", headers=headers)
res = conn.getresponse()
response_string = res.read().decode('utf-8')
response_obj = json.loads(response_string)
print(response_obj)

```

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [June 10, 2021, 3:09pm UTC](https://devforum.zoom.us/t/my-python-code-is-not-working-to-get-the-meetings-data/52117/2 "2021-06-10T15:09:43Z")

</div>

Hi @mohammed_zaid,

Have you tried testing the request out in a tool like Postman first? You might also find Postman helpful for generating the code necessary to initiate the request. If you don’t already have Postman, I recommend downloading it here:

> **[Download Postman | Try Postman for Free](https://www.postman.com/downloads/)**
>
> Try Postman for free! Join 13 million developers who rely on Postman, the collaboration platform for API development. Create better APIs—faster.

Here is an example of a GET request in Python, which you may also find helpful:

```auto
import requests

url = "https://api.zoom.us/v2/metrics/meetings?type=past"

payload = {}
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

```

Thanks,  
Will

---

<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:** [July 11, 2021, 1:09am UTC](https://devforum.zoom.us/t/my-python-code-is-not-working-to-get-the-meetings-data/52117/3 "2021-07-11T01:09:48Z")

</div>

Closed on July 11, 2021, 1:09am UTC

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