API Endpoint(s) and/or Zoom API Event(s)
https://zoom.us/oauth/token?grant_type=account_credentials&account_id=xxxxxxx
Description
Setting up a new Server to server internal app and running into an issue getting the access_token. I am using PHP on my server and attempting a curl request to the endpoint. I did find where someone else posted about this and have a code example very similar to theirs but I am still getting the following error message.
Error?
{“reason”:“Bad Request”,“error”:“invalid_request”}
How To Reproduce
$endpoint = 'https://zoom.us/oauth/token?grant_type=account_credentials&account_id=' . $int['api_key'];
$headers[] = "Authorization: Basic " . base64_encode($int['username'] . ":" . $int['password']);
$headers[] = "Content-Type: application/x-www-form-urlencoded";
$body = array(
'grant_type' => 'client_credentials'
);
// CURL to GET access_token
$ch = @curl_init();
@curl_setopt($ch, CURLOPT_POST, true);
@curl_setopt($ch, CURLOPT_URL, $endpoint);
@curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($body));
@curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
@curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = @curl_exec($ch);
$status_code = @curl_getinfo($ch, CURLINFO_HTTP_CODE);
$curl_errors = curl_error($ch);
@curl_close($ch);