# How do I get Bearer token?

**URL:** <https://devforum.zoom.us/t/how-do-i-get-bearer-token/89968>\
**Category:** Users and Groups\
**Tags:** api\
**Created:** [June 11, 2023, 7:56pm UTC](https://devforum.zoom.us/t/how-do-i-get-bearer-token/89968 "2023-06-11T19:56:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil.l](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/phil.l/32/49299_2.png) [@phil.l](https://devforum.zoom.us/u/phil.l)\
**Post date:** [June 11, 2023, 7:56pm UTC](https://devforum.zoom.us/t/how-do-i-get-bearer-token/89968/1 "2023-06-11T19:56:28Z")

</div>

**Description**  
I’m trying to call the Zoom API from a Google APPs Script (in javascript).  
I’ve set up my app on Zoom Marketplace as a: [Server-to-server OAuth]  
and as an [Account-level app]

I’m trying to follow the Zoom API documentation for making a GET User Details call (as per [this](https://developers.zoom.us/docs/api/rest/using-zoom-apis/#api-requests) portion of the Zoom API documentation).

However I keep getting the below error:  
**{“code”:124,“message”:“Invalid access token.”}**

I’m using my app’s Client Secret as the bearer token in the API call.  
Sorry - bit new at this so any help would be much appreciated!

**My code**

function getZoomUser() {  
var USER\_EMAIL = ‘tommy.t@mydomain.org’  
var apiUrl = “[https://api.zoom.us/v2/users/](https://api.zoom.us/v2/users/)”+USER\_EMAIL;

var headers = {  
“Content-Type”: “application/json”,  
“Authorization”: “Bearer myAppClientSecret”  
};

var options = {  
method: “GET”,  
headers: headers,  
muteHttpExceptions: true,  
};

var response = UrlFetchApp.fetch(apiUrl, options);  
Logger.log(response);  
}

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [June 12, 2023, 1:47pm UTC](https://devforum.zoom.us/t/how-do-i-get-bearer-token/89968/2 "2023-06-12T13:47:09Z")

</div>

Hi @phil.l  
If you are using a Server to Server Oauth app, you will need to use the account credentials to generate an access token, here is a link to our Docs:

> **[Internal apps (Server-to-server)](https://developers.zoom.us/docs/internal-apps/#use-account-credentials-to-get-an-access-token)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

Once you generate the token, you can pass this token as your Bearer token in the API call you are making

Hope this helps,  
Elisa

---

<div class="post-metadata">

**Author:** ![phil.l](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/phil.l/32/49299_2.png) [@phil.l](https://devforum.zoom.us/u/phil.l)\
**Post date:** [June 12, 2023, 8:24pm UTC](https://devforum.zoom.us/t/how-do-i-get-bearer-token/89968/3 "2023-06-12T20:24:27Z")

</div>

Aha! Perfect! That’s worked.  
Thanks so much 🙂
