# Server-to-Server OAuth Grant Type

**URL:** <https://devforum.zoom.us/t/server-to-server-oauth-grant-type/70638>\
**Category:** API and Webhooks\
**Created:** [June 16, 2022, 10:13pm UTC](https://devforum.zoom.us/t/server-to-server-oauth-grant-type/70638 "2022-06-16T22:13:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![backend\_zoom\_harral](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/backend_zoom_harral/32/38576_2.png) [@backend\_zoom\_harral](https://devforum.zoom.us/u/backend_zoom_harral)\
**Post date:** [June 16, 2022, 10:13pm UTC](https://devforum.zoom.us/t/server-to-server-oauth-grant-type/70638/1 "2022-06-16T22:13:15Z")

</div>

**Description**  
Attempting to use a Server-to-Server OAuth or regular OAuth App to retrive authorization bearer token. Then use this key to authenticate to the List Users Endpoint.

**Error?**  
Able to retrieve bearer token, however recieve a {“code”:200,“message”:“Invalid api key or secret.”} error when sending GET request to [https://api.zoom.us/v2/users](https://api.zoom.us/v2/users)

**API Endpoint/s?**  
List Users

**How To Reproduce**  
_Steps to reproduce the behavior:_  
_1. Request URL / Headers (without credentials) / Body_  
URL: [https://api.zoom.us/v2/users](https://api.zoom.us/v2/users)  
Method: GET  
Headers:  
“Authorization”: “Bearer {my\_token\_here}”  
Body: null

_2. Authentication method or app type_  
Server-to-Server OAuth & Regular OAuth

_3. Any errors_  
{“code”:200,“message”:“Invalid api key or secret.”}

**Additional context**  
Have used the the three grant types as query parameters:  
- grant\_type=client\_credentials  
- grant\_type=authorization\_code  
- grant\_type=account\_credentials

---

<div class="post-metadata">

**Author:** ![backend\_zoom\_harral](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/backend_zoom_harral/32/38576_2.png) [@backend\_zoom\_harral](https://devforum.zoom.us/u/backend_zoom_harral)\
**Post date:** [June 17, 2022, 6:08pm UTC](https://devforum.zoom.us/t/server-to-server-oauth-grant-type/70638/2 "2022-06-17T18:08:44Z")

</div>

Fixed by using the follow query parameters: ?grant\_type=account\_credentials&account\_id={account\_id}{account\_id} can be found by making a GET request [https://api.zoom.us/v2/accounts](https://api.zoom.us/v2/accounts)

See [Getting Account ID for server-to-server OAuth](https://devforum.zoom.us/t/getting-account-id-for-server-to-server-oauth/70559)

---

<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 18, 2022, 4:08am UTC](https://devforum.zoom.us/t/server-to-server-oauth-grant-type/70638/3 "2022-07-18T04:08:54Z")

</div>

Closed on July 18, 2022, 4:08am UTC

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