# Server-to-Server OAuth response

**URL:** <https://devforum.zoom.us/t/server-to-server-oauth-response/79648>\
**Category:** API and Webhooks\
**Tags:** api, server-to-server\
**Created:** [December 2, 2022, 11:54am UTC](https://devforum.zoom.us/t/server-to-server-oauth-response/79648 "2022-12-02T11:54:13Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![EVant](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/evant/32/3511_2.png) [@EVant](https://devforum.zoom.us/u/EVant)\
**Post date:** [December 2, 2022, 4:28pm UTC](https://devforum.zoom.us/t/server-to-server-oauth-response/79648/4 "2022-12-02T16:28:31Z")

</div>

This is the Python code to get the token and generate the headers

```auto
		with httpx.Client(auth=(ClientId,ClientSecret)) as client:
			params = {'grant_type': 'client_credentials'}
			r = client.post('https://zoom.us/oauth/token', params=params)

		token = r.json()["access_token"]
		headers = {'Authorization': f'Bearer {token}',
					'Content-type': 'application/json'}

```

The response seems ok  
`{"access_token":"eyJhbGciOiJIUzUx....J7hfYQ","token_type":"bearer","expires_in":3600,"scope":"meeting:master meeting:read:admin meeting:read:admin:sip_dialing meeting:write:admin meeting_token:read:admin:live_streaming meeting_token:read:admin:local_archiving meeting_token:read:admin:local_recording recording:master recording:read:admin recording:write:admin room:master room:read:admin room:write:admin user:master user:read:admin user:write:admin webinar:master webinar:read:admin webinar:write:admin webinar_token:read:admin:live_streaming webinar_token:read:admin:local_archiving webinar_token:read:admin:local_recording"}`

With this header I then call an a end point

```auto
with httpx.Client(http2=True, headers=headers, verify=True) as client:
           url = f'https://api.zoom.us/v2/users/{id}/meetings?\
                       page_number=1&page_size=300&type={meetingtype}'
           r = client.get(url)

```

---

_[View the full topic](https://devforum.zoom.us/t/server-to-server-oauth-response/79648)._
