Create a working file for a task. A working file is a revision of a file that an artist uses to make output files. The route uses the file tree of the project to make the path. If revision is 0, the route uses the next revision. The task is assigned to the current user. A vendor must have a task on the entity of the task. If software_id is not given, the route uses the Blender software and creates it if it does not exist. Only a manager of the project can give person_id to set another author. For other users, the author is always the current user.
POST
/data/tasks/{task_id}/working-files/new
curl
curl -X POST "http://api.example.com/data/tasks/a24a6ea4-ce75-4665-a070-57453082c25/working-files/new" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "main",
"mode": "working",
"description": "Main character model",
"comment": "Updated lighting and materials",
"person_id": "a24a6ea4-ce75-4665-a070-57453082c25",
"software_id": "a24a6ea4-ce75-4665-a070-57453082c25",
"revision": 1,
"sep": "/"
}'
import requests
url = "http://api.example.com/data/tasks/a24a6ea4-ce75-4665-a070-57453082c25/working-files/new"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"name": "main",
"mode": "working",
"description": "Main character model",
"comment": "Updated lighting and materials",
"person_id": "a24a6ea4-ce75-4665-a070-57453082c25",
"software_id": "a24a6ea4-ce75-4665-a070-57453082c25",
"revision": 1,
"sep": "/"
}
response = requests.post(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
Request examples
{
"name": "main",
"mode": "working",
"description": "Main character model",
"comment": "Updated lighting and materials",
"person_id": "a24a6ea4-ce75-4665-a070-57453082c250",
"software_id": "a24a6ea4-ce75-4665-a070-57453082c250",
"revision": 1,
"sep": "/"
}
Response examples (201)
{
"id": "b35b7fb5-df86-5776-b181-68564193d360",
"name": "main",
"path": "/project/asset/working/main_v001.blend",
"revision": 1,
"task_id": "c46c80c6-e097-6887-c292-79675204e470",
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-01-01T12:30:00Z"
}