Authorization error. Check your token and permissions

import requests

project_id = "475269d4-b695-4c2b-8d3a-3bec71893b8d"
url = f"https://api.frame.io/v2/projects/{project_id}"

headers = {"Authorization": "jwt token"}

# Make the initial request to get project information
response = requests.get(url, headers=headers)
data = response.json()

# Check if the request was successful (status code 200)
if response.status_code == 200:
    # Get the folder name
    folder_name = data["name"]
    print(f"Folder Name: {folder_name}")

    # Assuming the assets are in a list under "assets" key
    assets = data.get("assets", [])

    # Iterate through assets to get their names
    for asset in assets:
        asset_name = asset.get("name", "Unknown")
        print(f"Asset Name: {asset_name}")
else:
  if response.status_code == 401:
    print("Authorization error. Check your token and permissions.")
  else:
    print(f"Error fetching project information. Status code: {response.status_code}")`Preformatted text`

“C:\Users\PC1\PycharmProjects\psample framevod\venv\Lib\site-packages\moviepy\Scripts\python.exe” “C:\Users\PC1\PycharmProjects\psample framevod\main.py”
Authorization error. Check your token and permissions.

why my token is not valid when im using it to the Get Project by ID its working

Were you able to figure this out?

There are a couple of things it might be, but the most likely is that the token you’re using either doesn’t have access to this particular project or you haven’t selected the correct scopes to perform this particular action.

When using the Developer Site to make the sample request, did you pass in your developer token or did you just use the token loaded by default?