Need help on how to programatically get Access Token [PHP]

I need some help to how we can get Access Token for Zoom API? I need how can I implement it in a function so that I can refresh the zoom token every one hour

Hi @thomasprem95,

Happy to help point you in the right direction. Have you had a chance to review our OAuth flow here yet?

You can programmatically request the access_token from our OAuth endpoint. The API response will return both an access_token and a refresh_token—after you use the initial access_token, you’ll use that refresh_token that was returned initially to then request a new access_token on a regular cadence.

After you retrieve the authorization_code by installing your OAuth App, you can programmatically get the acsess_token and refresh_token—here is an example request in PHP:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://zoom.us/oauth/token?grant_type=authorization_code&code=%7Bcode%7D&redirect_uri=%7BredirectUrl%7D",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Basic {token}"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Best,
Will