コメントを取得

get
https://api.box.com/2.0
/comments/:comment_id

特定のコメントのメッセージとメタデータに加え、コメントを作成したユーザーに関する情報を取得します。

リクエスト

bearer [ACCESS_TOKEN]
application/json

パスパラメータ

stringパス内必須
12345

コメントのID。

クエリパラメータ

string arrayクエリ内省略可能
id,type,name

レスポンスに含める属性のコンマ区切りリスト。このパラメータを使用すると、標準のレスポンスには通常含まれないフィールドをリクエストできます。

このパラメータを指定すると、明示的に指定しない限り標準フィールドはレスポンスに含まれず、リクエストしたフィールドのほかには、Mini版の表示のフィールドしか返されないことに注意してください。

レスポンス

application/jsonコメント (Full)

Full版のコメントオブジェクトを返します。

予期しないクライアントエラー。

get
コメントを取得
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

cURL
curl -i -X GET "https://api.box.com/2.0/comments/12345" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
.NET
BoxComment comment = await client.CommentsManager.GetInformationAsync(id: "11111");
Java
BoxComment comment = new BoxComment(api, "id");
BoxComment.Info info = comment.getInfo();
Node
client.comments.get('11111')
    .then(comment => {
        /* comment -> {
            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' }
        */
    });
iOS
client.comments.get(commentId: "55555") { (result: Result<Comment, BoxSDKError>) in
    guard case let .success(comment) = result else {
        print("Error retrieving comment")
        return
    }

    print("Comment reads: \"\(comment.message)\"")
}

レスポンスの例

{
  "id": "11446498",
  "type": "comment",
  "created_at": "2012-12-12T10:53:43-08:00",
  "created_by": {
    "id": "11446498",
    "type": "user",
    "login": "ceo@example.com",
    "name": "Aaron Levie"
  },
  "is_reply_comment": true,
  "item": {
    "id": "11446498",
    "type": "file"
  },
  "message": "@Aaron Levie these tigers are cool!",
  "modified_at": "2012-12-12T10:53:43-08:00",
  "tagged_message": "@[1234567:Aaron Levie] these tigers are cool!"
}