Upload with py script via terminal issue

Hi all,

I’m trying to upload video files programmatically to my Frame.io project using the v4 API with an Adobe IMS access token. However, when I make a POST request to:

https://api.frame.io/v4/projects/{project_id}/assets

to create a new file asset, I get a consistent 404 Not Found error.

I’ve confirmed:

The project ID is correct.

The token has appropriate scopes.

Using GET /projects/{project_id}/assets?parent_id=null returns the root folder asset successfully.

The official docs mention an endpoint GET /projects/{project_id}/assets/root to get the root folder asset, but that also returns 404 with my token.

It seems with Adobe IMS tokens, the /projects/{project_id}/assets endpoint for asset creation might be disabled or replaced.

Has anyone else encountered this with IMS tokens? What’s the correct way to create/upload assets in a project using the v4 API with Adobe IMS tokens?

Any guidance or updated docs would be appreciated!

Thanks!

@stevenwl to upload video files you have 2 options:
Local Upload
POST https://api.frame.io/v4/accounts/:account_id/folders/:folder_id/files/local_upload
Remote Upload
https://api.frame.io/v4/accounts/:account_id/folders/:folder_id/files/remote_upload

POST https://api.frame.io/v4/projects/{project_id}/assets doesn’t exist that is why you are getting a 404

I’m not sure how you are getting the root folder via /projects/{project_id}/assets?parent_id=null, as that doesn’t exist as an endpoint. The root folder is listed in the response when you list the or show the current project:

GET https://api.frame.io/v4/accounts/:account_id/workspaces/:workspace_id/projects

{
  "data": [
    {
      "created_at": "2024-01-25T19:18:29.614189Z",
      "description": "Project Description",
      "id": "032deb4f-fb44-4be8-918a-051f2c7faf20",
      "name": "My Project",
      "root_folder_id": "b2b934b9-9966-4586-b58a-3954f4127e8d", # <-- This here
      "storage": 15000,
      "updated_at": "2024-02-07T16:44:41.986478Z",
      "view_url": "https://next.frame.io/project/d5e6011c-2bc9-4596-be05-77d562627112/",
      "workspace_id": "f2d46ac3-d60e-4060-abf0-82984883ea1c",
      "owner": {
        "active": true,
        "avatar_url": "https://assets.frame.io/uploads/cd58cb8e-24b3-4448-8d0f-9532fcd04d11/original.png?response-content-disposition=attachment%3B+filename%3D%22foo.png&Expires=1729857600&Signature=L09h0pi82dCrMYjr9lMHBragByWYh1&Key-Pair-Id=KKI497NESTHMN",
        "email": "user_email@example.com",
        "id": "196C1A5666BF4EB00A49411B@176719f5667c82b4494214.e",
        "name": "Jon Doe"
      }
    }
  ],
  "links": {
    "next": "/v4/accounts/1234/workspaces/5678/projects?after=g3QAAAACZAACaWRtAAAAJGFiMmNiY2QzLWFkODQtNDQwMC05YTRkLWE1ZDRkMGE4ZTIxM2QABG5hbWVtAAAACVByb2plY3QgMg=="
  },
  "total_count": 10
}