Replace the casting of a shot, an asset or an episode. Send the full list of assets. The assets that are not in the list are removed from the casting. To change one asset only, use the route that casts one asset in entities. You must be a manager of the project. Each entry must have asset_id and nb_occurences. An entry without nb_occurences is skipped and its asset is removed from the casting.
PUT
/data/projects/{project_id}/entities/{entity_id}/casting
curl
curl -X PUT "http://api.example.com/data/projects/a24a6ea4-ce75-4665-a070-57453082c25/entities/a24a6ea4-ce75-4665-a070-57453082c25/casting" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"casting": [
{
"asset_id": "c46c8gc6-eg97-6887-c292-79675204e47",
"asset_name": "Main Character"
}
]
}'
import requests
url = "http://api.example.com/data/projects/a24a6ea4-ce75-4665-a070-57453082c25/entities/a24a6ea4-ce75-4665-a070-57453082c25/casting"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"casting": [
{
"asset_id": "c46c8gc6-eg97-6887-c292-79675204e47",
"asset_name": "Main Character"
}
]
}
response = requests.put(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
Request examples
[
{
"asset_id": "b35b7fb5-df86-5776-b181-68564193d360",
"nb_occurences": 42,
"label": ""
}
]
Response examples (200)
{
"entity_id": "a24a6ea4-ce75-4665-a070-57453082c250",
"casting": [
{
"id": "b35b7fb5-df86-5776-b181-68564193d360",
"asset_id": "c46c80c6-e097-6887-c292-79675204e470",
"asset_name": "Main Character"
}
]
}