Update the fields of an entity. An entity is an asset, a shot, a sequence, an episode, an edit or a concept. Send only the fields to change. You cannot change id, created_at, updated_at, project_id, type, instance_casting, entities_in, entities_out, shotgun_id and created_by. An administrator, a manager of the project or the creator of the entity can change the other fields. The creator must be in the team of the project. A supervisor of the project with a department can change only the data field of an asset, a shot or an edit. Each key must be a metadata descriptor of one of their departments. A key that is not a descriptor of their departments refuses the whole update. A supervisor without a department can change the data field of every entity. The data field is merged with the current data. The name must be unique for the project, the type and the parent. When the frames or the name of a shot change, a new version of the shot is saved. Changes of one person that are less than one minute apart update the same version, for five minutes at most.
curl -X PUT "http://api.example.com/data/entities/a24a6ea4-ce75-4665-a070-57453082c25" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "SH010",
"data": {
"frame_in": 1001,
"frame_out": 1120
}
}'
import requests
url = "http://api.example.com/data/entities/a24a6ea4-ce75-4665-a070-57453082c25"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"name": "SH010",
"data": {
"frame_in": 1001,
"frame_out": 1120
}
}
response = requests.put(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
{
"name": "SH010",
"data": {
"frame_in": 1001,
"frame_out": 1120
}
}
{
"id": "a24a6ea4-ce75-4665-a070-57453082c250",
"name": "SH010",
"project_id": "b24a6ea4-ce75-4665-a070-57453082c250",
"data": {
"frame_in": 1001,
"frame_out": 1120
}
}