Downloading Zoom Recordings as Admin

Hi Team,

I am trying to download some Zoom Cloud recordings with a python script. I am getting bad request error.

Steps I followed:

  1. Created a Server to Server App.
  2. Got the Client ID and client Secret.
  3. I am using these in a python script as below.
import requests
import json

client_id = "dad87987d98f7a89ds7f89"
client_secret = "kaldjfklads8u8978789df7ads"

meeting_id = "970 3221 052"

data = {
    "grant_type": "account_credentials",
    "client_id": client_id,
    "client_secret": client_secret
}
response = requests.post("https://zoom.us/oauth/token", data=data)
print(response.json())
access_token = response.json()["access_token"]

headers = {
    "Authorization": f"Bearer {access_token}"
}

url = f"https://api.zoom.us/v2/metrics/meetings/{meeting_id}/report"

response = requests.get(url, headers=headers)

print(json.dumps(response.json(), indent=4))

I get {‘reason’: ‘Bad Request’, ‘error’: ‘invalid_request’} when I print access token.

Please help. Appreciate if you could guide me to an example python script.

Cheers,
Pavan.

  • For Server-to-Server OAuth, in the request body, pass grant_type=account_credentials&account_id= (with the account ID value) instead of the client ID and client secret.
  • Send the client ID and client secret as Basic authentication.
  • Make sure you declare the content type and format your body appropriately (this might be implied by Python, but it’s ambiguous to a casual reviewer): Content-Type: application/x-www-form-urlencoded; charset=utf-8

For details, see Server-to-Server OAuth | To generate an access token.

Hi Christopher,

Appreciate your help. was able to fix the issue with this input.

However, I have got a new issue. I am getting this error now. When I check the scope in Server-Server, these scopes are not there to enable. What am I missing? My objective is to download recordings as admin. What are the write access scope are required and where are they. Please advice.
{‘code’: 4711, ‘message’: ‘Invalid access token, does not contain scopes:[user:read:list_recordings:admin, user:read:list_recordings].’}

Make sure that the user that owns your application is set to a role that has permission to do the equivalent activities via the Zoom user interface. I’m guessing it’s filed under “Account Management; Recording management”. Then you can add the corresponding scopes.

The application owner needs to maintain these permissions on an ongoing basis. This gives the account owner transparency into what the application can do.

Hi Christopher,

I have Admin access on the web portal. I am able to see all the recordings and able to download them as well from the portal. However, getting this token error only on API calls.