# Invalid access token error in ZOOM

**URL:** <https://devforum.zoom.us/t/invalid-access-token-error-in-zoom/3796>\
**Category:** API and Webhooks\
**Created:** [March 30, 2019, 6:49pm UTC](https://devforum.zoom.us/t/invalid-access-token-error-in-zoom/3796 "2019-03-30T18:49:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![abraham1532002](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/abraham1532002/32/554_2.png) [@abraham1532002](https://devforum.zoom.us/u/abraham1532002)\
**Post date:** [March 30, 2019, 6:49pm UTC](https://devforum.zoom.us/t/invalid-access-token-error-in-zoom/3796/1 "2019-03-30T18:49:58Z")

</div>

The problem is that I can not communicate with the ZOOM server using cURL, because when the code is executed, it throws the error:

> api\_key=zo6vnIDiTD6sN2fuQ7hGrA&api\_secret=Z9iiHMSL6CEt35IVk9Z3MDYP0jWKZRR&data\_type=JSON&userId=profesor%40bitbcn.orgstring(46) “{“code”:124,“message”:“Invalid access token.”}”

This message is obtained after applying a `var_dump ()` to my `array` containing the response of the server.

**My code**

```
function getGrabacionesZOOM(){
        $request_url = $this->url;

/*Adds the Key, Secret, & Datatype to the passed array*/
$data['api_key'] = $this->api_key_ZOOM;
$data['api_secret'] = $this->api_secret_ZOOM;
$data['data_type'] = 'JSON';
        $data['userId']= 'profesor@bitbcn.org';

$postFields = http_build_query($data);
/*Check to see queried fields*/
/*Used for troubleshooting/debugging*/
echo $postFields;

/*Preparing Query...*/
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
//variable contenedora de la respuesta
$response = curl_exec($ch);
var_dump($response);
curl_close($ch);

```

}`

This code should be able to get this answer and then start analyzing the `array`.

> {  
> “from”: “string [date]”,  
> “to”: “string [date]”,  
> “page\_count”: “integer”,  
> “page\_size”: “integer”,  
> “total\_records”: “integer”,  
> “next\_page\_token”: “string”,  
> “meetings”: [  
> {  
> “uuid”: “string”,  
> “id”: “string”,  
> “account\_id”: “string”,  
> “host\_id”: “string”,  
> “topic”: “string”,  
> “start\_time”: “string [date-time]”,  
> “duration”: “integer”,  
> “total\_size”: “string”,  
> “recording\_count”: “string”,  
> “recording\_files”: [  
> {  
> “id”: “string”,  
> “meeting\_id”: “string”,  
> “recording\_start”: “string”,  
> “recording\_end”: “string”,  
> “file\_type”: “string”,  
> “file\_size”: “number”,  
> “play\_url”: “string”,  
> “download\_url”: “string”,  
> “status”: “string”,  
> “deleted\_time”: “string”,  
> “recording\_type”: “string”  
> }  
> ]  
> }  
> ]  
> }

As indicated in the [documentation](https://marketplace.zoom.us/docs/api-reference/zoom-api/cloud-recording/recordingslist) and in most cases the code is obtained from an example of [github](https://github.com/zoom/sample-app-php)

Thank you and I hope your support soon.

---

<div class="post-metadata">

**Author:** ![ojus.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ojus.zoom/32/734_2.png) [@ojus.zoom](https://devforum.zoom.us/u/ojus.zoom)\
**Post date:** [April 1, 2019, 3:11pm UTC](https://devforum.zoom.us/t/invalid-access-token-error-in-zoom/3796/2 "2019-04-01T15:11:11Z")

</div>

Hi,

The sample PHP app that you are trying to use is deprecated. We will inform you once we create a new one.  
In the mean time, can you please provide us with the error / error codes that you are receiving?

Thanks

---

<div class="post-metadata">

**Author:** ![abraham1532002](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/abraham1532002/32/554_2.png) [@abraham1532002](https://devforum.zoom.us/u/abraham1532002)\
**Post date:** [April 2, 2019, 5:20pm UTC](https://devforum.zoom.us/t/invalid-access-token-error-in-zoom/3796/3 "2019-04-02T17:20:42Z")

</div>

Ok then, how I could correctly implement this api in my Script. Thanks for your support.

---

<div class="post-metadata">

**Author:** ![ojus.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ojus.zoom/32/734_2.png) [@ojus.zoom](https://devforum.zoom.us/u/ojus.zoom)\
**Post date:** [June 3, 2019, 7:42pm UTC](https://devforum.zoom.us/t/invalid-access-token-error-in-zoom/3796/4 "2019-06-03T19:42:29Z")

</div>

Hi,

I have replied to your PM.

Thanks!

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 6:14pm UTC](https://devforum.zoom.us/t/invalid-access-token-error-in-zoom/3796/5 "2020-08-21T18:14:49Z")

</div>

Closed on August 21, 2020, 6:14pm UTC


