Skip to content

Instantly share code, notes, and snippets.

@nrctkno
Last active June 7, 2023 19:23
Show Gist options
  • Save nrctkno/50bfcb98d26d42a709019bcb5290e62a to your computer and use it in GitHub Desktop.
Save nrctkno/50bfcb98d26d42a709019bcb5290e62a to your computer and use it in GitHub Desktop.
<php
//uses Zumba Core HTTP as facade
function getToken(): string
{
$zoomAccountId = '';
$zoomClientId = '';
$zoomClientSecret = '';
$zoomOAuthUrl = 'https://zoom.us/oauth/token'; //note that this is not the same URL as the one for the API
$request = new Http($zoomOAuthUrl);
$request->headers([
'Authorization: Basic ' . base64_encode("$zoomClientId:$zoomClientSecret"),
]);
return $request->request('POST', [
'grant_type' => 'account_credentials',
'account_id' => $zoomAccountId
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment