ファイルに関するコメントのリストを取得します。
12345
ファイルを表す一意の識別子。
ファイルIDを確認するには、ウェブアプリケーションでファイルにアクセスして、URLからIDをコピーします。たとえば、URLがhttps://*.app.box.com/files/123
の場合、file_id
は123
です。
id,type,name
応答に含める属性のカンマ区切りリスト。このパラメータを使用すると、標準の応答には通常含まれないフィールドをリクエストできます。
このパラメータを指定すると、明示的に指定しない限り標準フィールドは応答に含まれず、リクエストしたフィールドのほかには、簡易版レプリゼンテーションのフィールドしか返されないことに注意してください。
1000
1000
返す項目の1ページあたりの最大数。
1000
0
応答が開始される項目のオフセット。
curl -X GET https://api.box.com/2.0/files/12345/comments \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
BoxFile file = new BoxFile(api, "id");
List<BoxComment.Info> comments = file.getComments();
comments = client.file(file_id='11111').get_comments()
for comment in comments:
print('Comment was left by {0} at {1}'.format(comment.created_by.name, comment.created_at))
var fileID = '12345';
client.files.getComments(fileID)
.then(comments => {
/* comments -> {
total_count: 1,
entries:
[ { type: 'comment',
id: '11111',
is_reply_comment: false,
message: 'Great work!',
created_by:
{ type: 'user',
id: '22222',
name: 'Example User',
login: 'user@example.com' },
created_at: '2012-12-12T11:25:01-08:00',
item: { id: '33333', type: 'file' },
modified_at: '2012-12-12T11:25:01-08:00' } ] }
*/
});
client.files.listComments(forFile: "11111"){ results in
switch results {
case let .success(iterator):
for i in 1 ... 10 {
iterator.next { result in
switch result {
case let .success(comment):
print(comment.message)
case let .failure(error):
print(error)
}
}
}
case let .failure(error):
print(error)
}
}