# I can not provide AccountID Access Can you help?

**URL:** <https://devforum.zoom.us/t/i-can-not-provide-accountid-access-can-you-help/97260>\
**Category:** Authentication\
**Tags:** api\
**Created:** [October 23, 2023, 11:45pm UTC](https://devforum.zoom.us/t/i-can-not-provide-accountid-access-can-you-help/97260 "2023-10-23T23:45:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehmet3387](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mehmet3387/32/53250_2.png) [@mehmet3387](https://devforum.zoom.us/u/mehmet3387)\
**Post date:** [October 23, 2023, 11:45pm UTC](https://devforum.zoom.us/t/i-can-not-provide-accountid-access-can-you-help/97260/1 "2023-10-23T23:45:22Z")

</div>

Hello everyone, I create my token with Client ID and Client Secret and get this token.

```auto

        $client = new Client();

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

        $accessToken = json_decode($response->getBody()->getContents())->access_token;
        $response = $client->get('https://api.zoom.us/v2/users/me', [
            'headers' => [
                'Authorization' => 'Bearer'. $accessToken,
                'Content-Type' => 'application/x-www-form-urlencoded',
            ],
        ]);

```

but when I try to get account\_id with the access\_token I created, I get an invalid token error.

> “Client error: `GET https://api.zoom.us/v2/users/me` resulted in a `401 Unauthorized` response:\n{"code":124,"message":"Invalid access token."}\n”

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [October 24, 2023, 7:42am UTC](https://devforum.zoom.us/t/i-can-not-provide-accountid-access-can-you-help/97260/2 "2023-10-24T07:42:30Z")

</div>

@mehmet3387 ,

Could you share if you are doing Oauth or Server to Server Oauth?

---

<div class="post-metadata">

**Author:** ![mehmet3387](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mehmet3387/32/53250_2.png) [@mehmet3387](https://devforum.zoom.us/u/mehmet3387)\
**Post date:** [October 24, 2023, 7:46am UTC](https://devforum.zoom.us/t/i-can-not-provide-accountid-access-can-you-help/97260/3 "2023-10-24T07:46:49Z")

</div>

I am using oAuth and I am trying to switch from jwt token to oAuth.

> **[Screenshot](https://prnt.sc/K2b_2RhZ6uYQ)**
>
> Captured with Lightshot

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [October 24, 2023, 7:56am UTC](https://devforum.zoom.us/t/i-can-not-provide-accountid-access-can-you-help/97260/4 "2023-10-24T07:56:11Z")

</div>

@mehmet3387

I’m doing something like this.  
For OAuth, the user typically clicks on a URL to install the app, and Zoom will redirect the token to your own hosted service. The below code is for my own hosted service on `php.asdc.cc/redirecturlforoauth.php`

```auto
<?php

$config = include 'config.php';
$oauthClientId = $config['oauth_client_id'];
$oauthClientSecret = $config['oauth_client_secret'];

$path='redirecturlforoauth.php';
$code =$_GET['code'];

    //echo "handleRedirectUrlDataRequest\n";
    $url = "https://zoom.us/oauth/token";
    $redirectUri = "https://php.asdc.cc/$path";
    //echo "$redirectUri\n";
    
    // Encode the client ID and client secret
    $credentials = "$oauthClientId:$oauthClientSecret";
    //echo "$credentials\n";
    $credentialsEncoded = base64_encode($credentials);

    $headers = [
        "Authorization: Basic $credentialsEncoded",
        "Content-Type: application/x-www-form-urlencoded"
    ];
    //echo "$credentialsEncoded\n";

    $data = [
        'grant_type' => 'authorization_code',
        'redirect_uri' => $redirectUri,
        'code' => $code
    ];
     //echo "$data\n";
    // Encode the data dictionary as x-www-form-urlencoded
    $dataEncoded = http_build_query($data);
    //echo "$dataEncoded\n";
    $options = [
        'http' => [
            'header' => implode("\r\n", $headers),
            'method' => 'POST',
            'content' => $dataEncoded
        ]
    ];
    $context = stream_context_create($options);
   
    $response = file_get_contents($url, false, $context);
    
    $httpStatus = $http_response_header[0]; // Get the HTTP status from the headers

    if (strpos($httpStatus, '200 OK') !== false) {
        //echo "response 200\n";
        $responseJson = json_decode($response, true); // Decode JSON as associative array
        
        // Optionally, you can return an HTTP status code
        http_response_code(200); // Replace 200 with your desired status code
        
        // Set the "Content-Type" header to "application/json"
        header('Content-Type: application/json');

        // Encode the JSON data and return it
        echo json_encode($responseJson);

   
    } else {
        // Handle the case where the response has an error status code
        echo "$httpStatus\n";
    }

?>

```

---

<div class="post-metadata">

**Author:** ![mehmet3387](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mehmet3387/32/53250_2.png) [@mehmet3387](https://devforum.zoom.us/u/mehmet3387)\
**Post date:** [October 24, 2023, 8:20am UTC](https://devforum.zoom.us/t/i-can-not-provide-accountid-access-can-you-help/97260/5 "2023-10-24T08:20:35Z")

</div>

I get the token, but I need zoom\_id, it doesn’t give me a return, in fact, the answers it gives are very absurd and strange.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [October 25, 2023, 2:49am UTC](https://devforum.zoom.us/t/i-can-not-provide-accountid-access-can-you-help/97260/6 "2023-10-25T02:49:32Z")

</div>

@mehmet3387 could you elaborate on what “zoom\_id” you are referring to?
