Create Reply

Create Reply

To create a reply to a previous comment, call the POST /comments API with the message of the new comment, as well as the ID of the previous comment to leave the reply on.

cURL
curl -i -X POST "https://api.box.com/2.0/comments" \
     -H "Authorization: Bearer <ACCESS_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{
       "message": "I agree with this.",
       "item": {
         "type": "comment",
         "id": 345344
       }
     }
Java
BoxComment comment = new BoxComment(api, "id");
comment.reply("I agree with this!");
Python
reply_comment = client.comment(comment_id='12345').reply('If possible, please finish this by the end of the week!')

A reply's message can also mentions users using the @ sign. To do so, add the string @[userid:name] anywhere within the message. The user_id is the target user's ID, where the name can be any custom phrase. In the Box UI this name will link to the user's profile.

Then, pass this string as the tagged_message instead of the message.

cURL
curl -i -X POST "https://api.box.com/2.0/comments" \
     -H "Authorization: Bearer <ACCESS_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{
       "message": " @[1234:John], I agree with this.",
       "item": {
         "type": "comment",
         "id": 345344
       }
     }
Java
BoxComment comment = new BoxComment(api, "id");
comment.reply("@[1234:user@box.com] I agree with this!");
Python
reply_comment = client.comment(comment_id='12345').reply('@[33333:John Doe], if possible, please finish this by the end of the week!')