Issue with Update/Patch File Metadata Fields with V4 API - get code 422

,

I can see you can update a files “default” data fields (metadata?) like this …

curl -X PATCH https://api.frame.io/v4/accounts/{myaccount_id}/files/{my_file_ID} \
-H “Authorization: Bearer ”
-H “Content-Type: application/json”
-d ‘{
“data”: {
“name”: “asset.png”
}
}’

(sorry for bad formatting, but you get the idea)

However, how do I patch the value of a custom field I created — say its called “My Custom Field”?

I tried following the same “data”: {“my_custom_field”: “my new value”} type construct but to no avail.

I get a status code 422.

Any pointers would be grant.

Cheers.

NOOP. I think I figured it out. I referenced this post …

But used this …

endpoint … https://api.frame.io/v4/accounts/{account_id}/projects/{project_id}/metadata/values

payload = {
    "data": {“file_ids”: [asset_id],
             “values”: [{"field_definition_id": field_definition_id, "value": "my value”}]
    }
}

i got the field_definition_id for my custom field (it doesn’t use the name) by calling this endpoint …

https://api.frame.io/v4/accounts/{account_id}/metadata/field_definitions

Hopefully this helps someone else out as well.

Glad you got it working! It does indeed need the uuid and not the field name to work properly.

Hi @FuBu ,

When I try to get the Field definitions via https://api.frame.io/v4/accounts/{account_id}/metadata/field_definitions

I get a 403 error saying a migration is required.

"errors": [
    {
      "title": "Forbidden",
      "detail": "Please migrate your account to account level metadata."
    }
  ]
}

Did it ask the same of you, while I understand an Adobe ticket will help here I do not know what would be the implications of such a migration on other scenarios.

@CharlieAnderson Would you be able to help ?

Thanks.

@patanupam4 Account Level Migrations (ALM) have not begun yet due to a delay on the engineering side. Any newly created frame.io account will have ALM on be default, so if you need this to work for development please feel free to create a new account to test with (the API will work with free accounts after the trial has lapsed).

1 Like

Sorry - @patanupam4 as @CharlieAnderson mentions, I too created a brand new frame.io account for this project, so didn’t run into any legacy or migration issues. Good luck!

1 Like