Error 400 when using Get all clips and Get Clips API

Hi, i am trying to use the /v2/clips endpoint to get all the current clips on my account, using the given code in the docs for the clips api for python:

import requests
url = baseUrl + “/v2/clips”
querystring = {“user_id”:“me”}
headers = {“Authorization”: “Bearer my_access_token”}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())

but i keep receiving error 400.

The token i am using is the access token from the /oauth/token endpoint, and the same token works for the upload endpoint (v2/clips/files/multipart).

in the app, i have granted the following permissions:
clips:read:list_collaborator:admin
clips:read:list_user_clips:admin
clips:write:upload_file:admin
clips:read:clip:admin

Thanks in advance.

Hi @Ranyel
Thanks for reaching out to us and welcome to the Zoom Developer Forum.
Are you still having this issue?
Can you please share the entire error you are getting?

Hi, yes, i am still receiving the error 400.

The only response i receive from the server is:

<Response [400]> '<html></html>'

i will include the results of a capture of the petition using HTTPToolkit to visualize the details:

Request:

METHOD: GET

URL https://fileapi.zoom.us/v2/clips?user_id=me

HEADERS

Accept:/

Accept-Encoding:gzip, deflate

Authorization:Bearer eyJzdiI6IjAwMDAw**********
Connection:keep-alive

Cookie:__cf_bm=JOQ4udkx*******; _zm_ctaid=9wSFZAXiTX********; _zm_mtk_guid=dfdf8*******; _zm_page_auth=aw1_c_Z6******; _zm_ssid=aw1_c_HZo********; cred=3A4266B2*****

Host:fileapi.zoom.us

User-Agent:python-requests/2.32.3

Response:

STATUS: 400 Bad Request

HEADERS

Connection:close

Content-Length:13

Content-Type:text/plain; charset=utf-8

Date:Wed, 16 Apr 2025 14:45:00 GMT

Response body

<html></html>

and i will also add the exact code i am using:

import asyncio
import requests
import base64
import os
import datetime
import logging
from pprint import pprint


class Manager:
    def __init__(self):
        self.access_token = None
        self.session = requests.Session()

    def get_zoom_access_token(self):
            """Generate a Zoom access token using account_credentials grant type"""
            
            # Get credentials from environment variables
            account_id = os.getenv("ZOOM_ACCOUNT_ID")
            client_id = os.getenv("ZOOM_CLIENT_ID")
            client_secret = os.getenv("ZOOM_CLIENT_SECRET")

            # Check if credentials are available
            if not all([account_id, client_id, client_secret]):
                raise ValueError("Zoom API credentials not found in environment variables")
            
            # Encode client_id and client_secret in base64
            credentials = f"{client_id}:{client_secret}"
            encoded_credentials = base64.b64encode(credentials.encode()).decode()
            
            # Set up request headers
            headers = {
                "Content-Type": "application/x-www-form-urlencoded",
                "Authorization": f"Basic {encoded_credentials}"
            }
            
            # Set up request body
            data = {
                "grant_type": "account_credentials",
                "account_id": account_id
            }
        
            # Make the request to get the access token
            response = self.session.post("https://zoom.us/oauth/token", headers=headers, data=data)
            
            # Check if the request was successful
            if response.status_code == 200:
                token_data = response.json()

                self.access_token = {
                    "token": token_data["access_token"],
                    "created_at": datetime.datetime.now()
                }

                print(f"Zoom access token created.")

                return self.access_token
            else:
                error_message = f"Failed to get Zoom access token: {response.status_code} - {response.text}"
                print(error_message)
                raise Exception(error_message)

    def get_clips(self):

        url = "https://fileapi.zoom.us/v2/clips"

        querystring = {"user_id":"me"}

        headers = {"Authorization": f"Bearer {self.access_token['token']}"}

        # proxy = "http://127.0.0.1:8000"
        proxy = None

        # response = self.session.get(url, headers=headers, params=querystring, proxies={"http": proxy, "https": proxy}, verify=False)
        response = self.session.get(url, headers=headers, params=querystring)

        print("Status Code:")
        print(response.status_code)

        print("Response:")
        print(response)

        # pprint(response.json())
        print(response.text)


if __name__ == "__main__":
    manager = Manager()
    manager.get_zoom_access_token()
    manager.get_clips()

Thanks in advance

Hey @Ranyel
I am not able to replicate this on my end. I am getting the response data back when calling the Get Clips endpoint.
Can you please try making this request using a tool like postman or send a curl request to confirm this works

curl --location --request GET 'https://api.zoom.us/v2/clips?user_id=me' \
--header 'Authorization: Bearer {your access token}'
2 Likes

Hi again, thanks for your last answer, i was able to find my problem:

in the Zoom Clips Docs, the documentation uses the following example to get the clips:

curl --request GET \
  --url 'https://fileapi.zoom.us/v2/clips?user_id=me' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

using the endpoint:

GET https://fileapi.zoom.us/v2/clips?user_id=me

in your answer:

curl  --request GET 'https://api.zoom.us/v2/clips?user_id=me' \
--header 'Authorization: Bearer {your access token}'

you used a different endpoint:

GET https://api.zoom.us/v2/clips?user_id=me

so the endpoint was the problem.

Thanks for your time and help.

2 Likes

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