Lists all tasks for a file

Guides Tasks Lists all tasks for a file
Edit this page

Lists all tasks for a file

To list all of the tasks for a specific file, call the GET /files/:id/tasks with the id of the file.

cURL
curl -i -X GET "https://api.box.com/2.0/files/12345/tasks" \
     -H "Authorization: Bearer <ACCESS_TOKEN>"
Java
BoxFile file = new BoxFile(api, "id");
List<BoxTask.Info> tasks = file.getTasks();
Python
tasks = client.file(file_id='11111').get_tasks()
for task in tasks:
    print('Task ID is {0} and the type is {1}'.format(task.id, task.type))
iOS
let iterator = client.files.listTasks(forFile: "11111")
iterator.next { results in
    switch results {
    case let .success(page):
        for task in page.entries {
            print("Task messsage: \(task.message)")
        }

    case let .failure(error):
        print(error)
    }
}