# Issue retrieving contact\_center/queues data - Invalid access token in Server-Server OAuth

**URL:** <https://devforum.zoom.us/t/issue-retrieving-contact-center-queues-data-invalid-access-token-in-server-server-oauth/105471>\
**Category:** API and Webhooks\
**Tags:** api\
**Created:** [March 11, 2024, 1:34pm UTC](https://devforum.zoom.us/t/issue-retrieving-contact-center-queues-data-invalid-access-token-in-server-server-oauth/105471 "2024-03-11T13:34:59Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jing.wang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jing.wang/32/57390_2.png) [@jing.wang](https://devforum.zoom.us/u/jing.wang)\
**Post date:** [March 11, 2024, 1:34pm UTC](https://devforum.zoom.us/t/issue-retrieving-contact-center-queues-data-invalid-access-token-in-server-server-oauth/105471/1 "2024-03-11T13:34:59Z")

</div>

**API Endpoint(s) and/or Zoom API Event(s)**

> **[Contact Center API](https://developers.zoom.us/docs/contact-center/apis/#operation/listQueues)**
>
> 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.

**Description:**  
I have successfully implemented the retrieval of call\_logs data using the same client\_id and secret\_id when generating the access token. However, when attempting to retrieve contact\_center/queues data, I am encountering an “Invalid access token” error message.  
I would like to clarify whether there is a separate or additional scope required to access contact center data through the API.

**Error:**  
{  
“errorCode”: “401”,  
“errorMessage”: “Invalid access token.”,  
“status”: false  
}

**How To Reproduce:**  
Create Server-Server OAuth App  
Add the following scope:  
- View your contact center queue information / contact\_center\_queue:read:admin  
- View all users’ phone information / phone:read:admin

---

<div class="post-metadata">

**Author:** ![Justin\_B](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@Justin\_B](https://devforum.zoom.us/u/Justin_B)\
**Post date:** [March 12, 2024, 3:19pm UTC](https://devforum.zoom.us/t/issue-retrieving-contact-center-queues-data-invalid-access-token-in-server-server-oauth/105471/2 "2024-03-12T15:19:21Z")

</div>

Having this exact same issue on code that was not originally having this issue. We haven’t moved the client\_id, client\_secret, or anything else into production, so there’s only one machine that’s attempting token requests.

Even stranger, we can hit Zoom Phone endpoints just fine with the exact same access\_token, but using the same token for Contact Center yields the exact same issue mentioned here. Invalid access token. Quick python example below demonstrates exactly what is happening for us. The Zoom Phone API call is successful, the Zoom Contact Center call is not with the exact same token that has scopes for (at least per the documentation) both.

```python
import requests
import urllib
api_url = "https://zoom.us/oauth/token"
accout_id = "xxxxxxxxxxxxxx"
client_id = "xxxxxxxxxxxxxxx"
client_secret = "xxxxxxxxxxxxxx"
basic = requests.auth.HTTPBasicAuth(client_id, client_secret)
headers = {"Content-Type":"application/x-www-form-urlencoded"}
parms = {"grant_type":"account_credentials","account_id":account_id}
outdata = urllib.parse.urlencode(parms)
response = requests.post(api_url, data=outdata, headers=headers, auth=basic)
access_token = response.json()['access_token']
# Access token obtained from Zoom
#
#
zoom_base_api = 'https://api.zoom.us/v2'
headers = {"Authorization" : "Bearer " + access_token}
start_date = '2024-03-11'
end_date = '2024-03-12'
page_size = '300'
site_id = 'xxxxxxxxxxxxxxxxxxxxxxxxx'
parms = {"from":start_date,"to":end_date,"page_size":page_size,"site_id":site_id}
outdata = urllib.parse.urlencode(parms)
response = requests.get(zoom_base_api+"/phone/recordings", params=outdata, headers=headers)
# A listing of Zoom Phone recordings is obtained in response
#
#
parms = {"from":start_date, "to":end_date}
outdata = urllib.parse.urlencode(parms)
response = requests.get(zoom_base_api+"/contact_center/recordings", params=parms, headers=headers)
# errorCode 401, errorMessage Invalid access token
#

```

---

<div class="post-metadata">

**Author:** ![jing.wang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jing.wang/32/57390_2.png) [@jing.wang](https://devforum.zoom.us/u/jing.wang)\
**Post date:** [March 12, 2024, 3:44pm UTC](https://devforum.zoom.us/t/issue-retrieving-contact-center-queues-data-invalid-access-token-in-server-server-oauth/105471/3 "2024-03-12T15:44:55Z")

</div>

Exactly the same here:

| call\_logs | /phone/call\_logs | OK |
| --- | --- | --- |
| call\_history | /phone/call\_history | OK |
| call\_path | /phone/call\_history/{callLogID} | OK |
| contact\_center\_queues | /contact\_center/queues | NG |

---

<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:** [March 13, 2024, 2:50am UTC](https://devforum.zoom.us/t/issue-retrieving-contact-center-queues-data-invalid-access-token-in-server-server-oauth/105471/4 "2024-03-13T02:50:26Z")

</div>

Hi @jing.wang , @Justin_B

Private messaging you both for the following:

- client id associated with request
- developer email associated with app
- log of request

---

<div class="post-metadata">

**Author:** ![jing.wang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jing.wang/32/57390_2.png) [@jing.wang](https://devforum.zoom.us/u/jing.wang)\
**Post date:** [March 13, 2024, 3:10am UTC](https://devforum.zoom.us/t/issue-retrieving-contact-center-queues-data-invalid-access-token-in-server-server-oauth/105471/6 "2024-03-13T03:10:45Z")

</div>

Hi Gianni,

Here is the information you requested:  
[REDACTED]

---

<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:** [March 14, 2024, 4:09am UTC](https://devforum.zoom.us/t/issue-retrieving-contact-center-queues-data-invalid-access-token-in-server-server-oauth/105471/7 "2024-03-14T04:09:05Z")

</div>

Hi @jing.wang ,

I’ve redacted your info since you did not share in the private message. I have opened an inquiry with our API team about the behavior you and others are seeing (ZSEE-122399). I will share updates as they become available.

---

<div class="post-metadata">

**Author:** ![jing.wang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jing.wang/32/57390_2.png) [@jing.wang](https://devforum.zoom.us/u/jing.wang)\
**Post date:** [March 14, 2024, 4:30am UTC](https://devforum.zoom.us/t/issue-retrieving-contact-center-queues-data-invalid-access-token-in-server-server-oauth/105471/8 "2024-03-14T04:30:37Z")

</div>

Hi Gianni,

Thank you for your prompt action and for opening an inquiry with the API team. I appreciate your attention to this matter and look forward to receiving updates as they become available.

---

<div class="post-metadata">

**Author:** ![Justin\_B](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@Justin\_B](https://devforum.zoom.us/u/Justin_B)\
**Post date:** [March 14, 2024, 9:11pm UTC](https://devforum.zoom.us/t/issue-retrieving-contact-center-queues-data-invalid-access-token-in-server-server-oauth/105471/9 "2024-03-14T21:11:22Z")

</div>

My issue was resolved. It seems that we had an administrative issue where the person who had the master account for our ZCC was changed without any of the devs being notified.

---

<div class="post-metadata">

**Author:** ![jing.wang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jing.wang/32/57390_2.png) [@jing.wang](https://devforum.zoom.us/u/jing.wang)\
**Post date:** [March 15, 2024, 5:32pm UTC](https://devforum.zoom.us/t/issue-retrieving-contact-center-queues-data-invalid-access-token-in-server-server-oauth/105471/11 "2024-03-15T17:32:48Z")

</div>

The problem has been successfully resolved after I was added as an admin to ZCC.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [March 16, 2024, 5:33pm UTC](https://devforum.zoom.us/t/issue-retrieving-contact-center-queues-data-invalid-access-token-in-server-server-oauth/105471/12 "2024-03-16T17:33:36Z")

</div>

Closed on March 16, 2024, 5:33pm UTC

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