# Issue with Zoom API - Migration from JWT to Server-to-Server OAuth - PHP cUrl -code":200,"message":"Account does not enabled REST API."

**URL:** <https://devforum.zoom.us/t/issue-with-zoom-api-migration-from-jwt-to-server-to-server-oauth-php-curl-code-200-message-account-does-not-enabled-rest-api/95052>\
**Category:** Meetings\
**Tags:** php\
**Created:** [September 13, 2023, 7:56pm UTC](https://devforum.zoom.us/t/issue-with-zoom-api-migration-from-jwt-to-server-to-server-oauth-php-curl-code-200-message-account-does-not-enabled-rest-api/95052 "2023-09-13T19:56:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![training6](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@training6](https://devforum.zoom.us/u/training6)\
**Post date:** [September 13, 2023, 7:56pm UTC](https://devforum.zoom.us/t/issue-with-zoom-api-migration-from-jwt-to-server-to-server-oauth-php-curl-code-200-message-account-does-not-enabled-rest-api/95052/1 "2023-09-13T19:56:07Z")

</div>

Hi,

I’m trying to migrate our PHP Curl code to a server-to-server OAuth zoom app.

I’m able to get an access token but once I want to get infos about a meeting I got this message:

code":200,“message”:“Account does not enabled REST API.”

Same message if I use postman.

Here is an example of my PHP Code to get a meeting:

```
                      $webinar_zoom_id = str_replace(' ', '', $webinar_zoom_id);

                        $curl = curl_init();
                        curl_setopt_array($curl, array(  
                            CURLOPT_URL => https://api.zoom.us/v2/meetings/.$webinar_zoom_id,   
                            CURLOPT_RETURNTRANSFER => true,
                            CURLOPT_ENCODING => "",
                            CURLOPT_MAXREDIRS => 10,
                            CURLOPT_TIMEOUT => 30,
                            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                            CURLOPT_CUSTOMREQUEST => "GET",
                            CURLOPT_HTTPHEADER => array(
                                "Authorization: Bearer ".$tokenV2."",
                                "cache-control: no-cache"
                            ),
                        ));
                         
                        $response = curl_exec($curl);
                        //var_dump($response);
                        $err = curl_error($curl);
                         
                        curl_close($curl);                        
                         
                        if ($err) {
                          echo "cURL Error #:" . $err;
                        } else {
                          $responseDecode = json_decode($response);
                        }

```

Could you help me to solve this issue please ?

Thanks a lot for your help.

---

<div class="post-metadata">

**Author:** ![Lunchdog](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@Lunchdog](https://devforum.zoom.us/u/Lunchdog)\
**Post date:** [September 13, 2023, 8:18pm UTC](https://devforum.zoom.us/t/issue-with-zoom-api-migration-from-jwt-to-server-to-server-oauth-php-curl-code-200-message-account-does-not-enabled-rest-api/95052/2 "2023-09-13T20:18:06Z")

</div>

Hey, I ran into this when starting out too! I think the issue is the original bearer token - make sure to request “account\_credentials” via the “grant\_type” parameter

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [September 13, 2023, 9:03pm UTC](https://devforum.zoom.us/t/issue-with-zoom-api-migration-from-jwt-to-server-to-server-oauth-php-curl-code-200-message-account-does-not-enabled-rest-api/95052/4 "2023-09-13T21:03:51Z")

</div>

Hi @training6 ,

Is this the postman link from our workspace you used? [Postman](https://www.postman.com/zoom-developer/workspace/zoom-public-workspace/request/22097587-875f65b4-d88f-4082-80af-7605303a5abc)

> [@Lunchdog](#):
>
> Hey, I ran into this when starting out too! I think the issue is the original bearer token - make sure to request “account\_credentials” via the “grant\_type” parameter

Please let us know if that helps resolve!

---

<div class="post-metadata">

**Author:** ![training6](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@training6](https://devforum.zoom.us/u/training6)\
**Post date:** [September 14, 2023, 7:35am UTC](https://devforum.zoom.us/t/issue-with-zoom-api-migration-from-jwt-to-server-to-server-oauth-php-curl-code-200-message-account-does-not-enabled-rest-api/95052/5 "2023-09-14T07:35:06Z")

</div>

Hi, thanks a lot for your help.

Here my code to get token:

```auto
$url = 'https://zoom.us/oauth/token';
	$data = array(
       'grant_type' => 'account_credentials'
    );
    
    $headers = array(
        'Authorization: Basic '. base64_encode($zoomAPIKey.":".$zoomSecretKey)
    );
    
    $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_POST, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
        curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($curl);
    
    if(curl_errno($curl)) {
        echo 'Curl error: ' . curl_error($curl);
    }
    
    curl_close($curl);

```

now i have bad request message (i changed client\_credentials to account\_credentials)

What do I have to change ?

---

<div class="post-metadata">

**Author:** ![Lunchdog](https://avatars.discourse-cdn.com/v4/letter/l/ea666f/32.png) [@Lunchdog](https://devforum.zoom.us/u/Lunchdog)\
**Post date:** [September 14, 2023, 3:45pm UTC](https://devforum.zoom.us/t/issue-with-zoom-api-migration-from-jwt-to-server-to-server-oauth-php-curl-code-200-message-account-does-not-enabled-rest-api/95052/7 "2023-09-14T15:45:26Z")

</div>

A request for account\_credentials requires an account\_id in the URL, and a ClientID/ClientSecret in the request itself: " To use account credentials to get an access token for your app, call the Zoom OAuth token API with the `account_credentials` `grant_type` , your `account_id` , and your client ID and client secret, [base64 encoded](https://www.base64encode.org/) (encode your client ID and client secret with a colon between them, e.g. `client_id:client_secret` )."

> **[Server-to-Server OAuth](https://developers.zoom.us/docs/internal-apps/s2s-oauth/)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

By the way, it’s far easier to create/compose these requests using Postman, or if you’re sold on just PHP, something like Guzzle.

---

<div class="post-metadata">

**Author:** ![training6](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@training6](https://devforum.zoom.us/u/training6)\
**Post date:** [September 15, 2023, 7:51am UTC](https://devforum.zoom.us/t/issue-with-zoom-api-migration-from-jwt-to-server-to-server-oauth-php-curl-code-200-message-account-does-not-enabled-rest-api/95052/8 "2023-09-15T07:51:15Z")

</div>

Hi,

Thanks a lot, it works now, I got the right token and can access method I want 🙂

Big thank you both of you!

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [September 15, 2023, 12:39pm UTC](https://devforum.zoom.us/t/issue-with-zoom-api-migration-from-jwt-to-server-to-server-oauth-php-curl-code-200-message-account-does-not-enabled-rest-api/95052/9 "2023-09-15T12:39:05Z")

</div>

Glad this is resolved! Thank you everyone!

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [September 15, 2023, 12:39pm UTC](https://devforum.zoom.us/t/issue-with-zoom-api-migration-from-jwt-to-server-to-server-oauth-php-curl-code-200-message-account-does-not-enabled-rest-api/95052/10 "2023-09-15T12:39:17Z")

</div>

Closed on September 15, 2023, 12:39pm UTC


