Create a playlist. Send the fields of the new row in JSON. You must be an administrator, or a manager or a supervisor in the team of the project. The route sets created_by to you. for_entity must be a valid value. An episode_id of all or main gives no episode. A task_type_id that is not a valid UUID gives no task type. In shots, the route removes a preview that does not belong to its entity.
POST
/data/playlists
curl
curl -X POST "http://api.example.com/data/playlists/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Playlist Name",
"project_id": "a24a6ea4-ce75-4665-a070-57453082c25",
"episode_id": "b24a6ea4-ce75-4665-a070-57453082c25",
"task_type_id": "c24a6ea4-ce75-4665-a070-57453082c25"
}'
import requests
url = "http://api.example.com/data/playlists/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"name": "Playlist Name",
"project_id": "a24a6ea4-ce75-4665-a070-57453082c25",
"episode_id": "b24a6ea4-ce75-4665-a070-57453082c25",
"task_type_id": "c24a6ea4-ce75-4665-a070-57453082c25"
}
response = requests.post(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
Request examples
{
"name": "Playlist Name",
"project_id": "a24a6ea4-ce75-4665-a070-57453082c250",
"episode_id": "b24a6ea4-ce75-4665-a070-57453082c250",
"task_type_id": "c24a6ea4-ce75-4665-a070-57453082c250",
"shots": [
{
"entity_id": "string",
"preview_file_id": "string"
}
]
}
Response examples (201)
{
"id": "a24a6ea4-ce75-4665-a070-57453082c250",
"name": "Playlist Name",
"project_id": "b24a6ea4-ce75-4665-a070-57453082c250",
"episode_id": "c24a6ea4-ce75-4665-a070-57453082c250",
"task_type_id": "d24a6ea4-ce75-4665-a070-57453082c250",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}