Hi,
I am trying to request an access token using Server-to-Server oAuth via PHP.
This is my code:
// The API endpoint for obtaining an access token
$token_endpoint = ‘/oauth/token’;// The scope of the access token $scope = 'scope:read:admin'; try { // Request an access token using the account_credentials grant type $response = $client->post($token_endpoint, [ 'headers' => [ 'Authorization' => 'Basic ' . base64_encode($client_id . ':' . $client_secret), 'Content-Type' => 'application/x-www-form-urlencoded', ], 'form_params' => [ 'grant_type' => 'account_credentials', 'scope' => $scope, ], ]);
However I get the following error:
Client error: POST https://zoom.us/oauth/token
resulted in a 400 Bad Request
response: {“reason”:“Bad Request”,“error”:“invalid_request”}
When I change the grant type to “client_credentials” it returns me an access token?
Can anyone help?
Kind Regards.