Issue retrieving contact_center/queues data - Invalid access token in Server-Server OAuth

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

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

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.

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
#

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

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

Hi Gianni,

Here is the information you requested:
[REDACTED]

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.

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.

1 Like

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.

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

1 Like

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