Activating REST API on Account & Laravel Intergration

I have created a Server-To-Server OAuth App on Marketplace and linked authenticated the connection in PHP to receive a token. I am then trying to gather information about users to confirm that the API can be called. I recieve the following error.

Client error: GET https://api.zoom.us/v2/users resulted in a 400 Bad Request response: {“code”:200,“message”:“Account does not enabled REST API.”}

I have a Zoom One account, and can not find the way to enable the REST API and gain access to this service.

Code is below:

 $client = new Client();

        $response = $client->post('https://zoom.us/oauth/token', [
            'form_params' => [
                'grant_type' => 'client_credentials',
                'client_id' => env('ZOOM_CLIENT_ID'),
                'client_secret' => env('ZOOM_CLIENT_SECRET'),
            ],
        ]);

        $accessToken = json_decode($response->getBody()->getContents())->access_token;

        $response2 = $client->get('https://api.zoom.us/v2/users', [
            'headers' => [
                'Authorization' => 'Bearer ' . $accessToken,
                'Content-Type' => 'application/json',
            ],
        ]);

        $users = json_decode($response2->getBody()->getContents())->users;

        return $users;

If I return the value of $accessToken, I recieve a token string from the API, so the issue is in the second half.

Does anyone have any ideas? I have tried a few tickets from here but I can not find the setting anywhere.

Also, does anyone have a package or method for interacting with the API in Laravel 9? I am unable to find a package for this and wondering if anyone has any leeds.

Joshua

Hi @joshuamicallef66
Thanks for reaching out to the Zoom Developer Forum, I am happy to help here!
It looks like you are passing the wrong grant_type in your request. The grant_type should be account_credentials and you should be passing the account_id value as well.

Here is a link to a useful guide on how to use Server to Server oauth with Postman

Let me know if this helps,
Elisa

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.