My server 2 server access token expired recently.
I’m trying to write some PHP code to get a new access token. On this page:
https://marketplace.zoom.us/docs/guides/build/server-to-server-oauth-app/
You say to use this curl command:
curl -X POST -H 'Authorization: Basic Base64Encoder(clientId:clientSecret)' https://zoom.us/oauth/token?grant_type=account_credentials&account_id={accountId}
I’ve tried this but it’s returning a 405 Method Not Allowed error.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, “https://zoom.us/oauth/token?grant_type=account_credentials&account_id=xxxxxxxxxxxxxxxxx”);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Set the Authorization header
$auth = “Basic Base64Encoder(” . base64_encode(“yyyyyyyyyyyyyyyyyyy:zzzzzzzzzzzzzzzzzzzzzzzzzz”). “)”;
curl_setopt($ch, CURLOPT_HTTPHEADER, array(“Authorization: $auth”));
$output = curl_exec($ch);
curl_close($ch);
echo $output;
What’s the correct way to use php to call your api to get a new server 2 server access token?