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 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/”+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);
}