コメントを更新

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

コメントのメッセージを更新します。

リクエスト

application/json

パスパラメータ

stringパス内必須
12345

コメントのID。

クエリパラメータ

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

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

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

リクエスト本文

string本文内省略可能
Review completed!

更新するコメントのテキスト

レスポンス

application/jsonComment

更新されたコメントオブジェクトを返します。

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

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

リクエストの例

cURL
curl -X PUT https://api.box.com/2.0/comments/12345 \
     -H 'Authorization: Bearer <ACCESS_TOKEN>" '
     -H 'Content-Type: application/json" '
     -d '{
       "message": "My New Message"
     }'
.NET
var requestParams = new BoxCommentRequest()
{
    Message = "New message"
};
BoxComment updatedComment = await client.CommentsManager.UpdateAsync(id: "11111", requestParams);
Java
BoxComment comment = new BoxComment(api, "id");
comment.changeMessage("An edited message.");
Python
edited_comment = client.comment(comment_id='98765').edit('If possible, please finish this by Friday!')
Node
client.comments.update('11111', {message: 'New message'})
    .then(comment => {
        /* comment -> {
            type: 'comment',
            id: '11111',
            is_reply_comment: false,
            message: 'New message',
            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.update(
    commentId: "55555",
    message: "Updated message"
) { (result: Result<Comment, BoxSDKError>) in
    guard case let .success(comment) = result else {
        print("Error updating comment")
        return
    }

    print("Comment message updated")
}