そのファイルに関連するすべてのタスクのリストを取得します。このエンドポイントはページ割りをサポートしていません。
12345
ファイルを表す一意の識別子。
ファイルIDを確認するには、ウェブアプリケーションでファイルにアクセスして、URLからIDをコピーします。たとえば、URLがhttps://*.app.box.com/files/123
の場合、file_id
は123
です。
ファイルに関連するタスクのリストを返します。
このファイルに関連するタスクが存在しない場合は、空のコレクションが返されます。
ファイルが見つからない場合、またはユーザーがファイルにアクセスできない場合はエラーを返します。
file_id
が指定されていない場合はエラーを返します。
IDが0
のファイルのタスクを取得しようとした場合はエラーを返します。
予期しないクライアントエラー。
curl -X GET https://api.box.com/2.0/files/12345/tasks \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
BoxCollection<BoxTask> tasks = await client.FilesManager.FilesManager.GetFileTasks("11111");
BoxFile file = new BoxFile(api, "id");
List<BoxTask.Info> tasks = file.getTasks();
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))
client.files.getTasks('11111')
.then(tasks => {
/* tasks -> {
total_count: 1,
entries:
[ { type: 'task',
id: '22222',
item:
{ type: 'file',
id: '11111',
sequence_id: '6',
etag: '6',
sha1: '81cc829fb8366fcfc108aa6c5a9bde01a6a10c16',
name: 'box-logo.png' },
due_at: null } ] }
*/
});
client.files.listTasks(forFile: "11111") { results in
switch results {
case let .success(iterator):
for i in 1 ... 10 {
iterator.next { result in
switch result {
case let .success(item):
print("Task messsage: \(task.message)")
case let .failure(error):
print(error)
}
}
}
case let .failure(error):
print(error)
}
}