如何将评论添加到Box REST API中的注释中?

时间:2015-04-14 18:55:46

标签: box-api boxapiv2

如何将评论添加到Box REST API的评论中?

例如,我如何返回评论的评论(标记为红色)(标记为黑色)?

enter image description here

1 个答案:

答案 0 :(得分:2)

它们应该包含在文件的列表注释中。唯一的区别是回复评论的is_reply_comment字段设置为true。

请注意,返回的注释的顺序很重要。由于回复只能是一级深度,因此回复评论始终与其上方的第一个非回复评论相关联。

这是一个示例回复,包括评论和对第一条评论的回复:

GET https://api.box.com/2.0/files/28785720644/comments

{
  "total_count": 2,
  "offset": 0,
  "limit": 100,
  "entries": [
    {
      "type": "comment",
      "id": "63003535",
      "is_reply_comment": false,
      "message": "First message",
      "created_by": {
        "type": "user",
        "id": "221860571",
        "name": "Name",
        "login": "login@gmail.com"
      },
      "created_at": "2015-04-14T17:49:07-07:00"
    },
    {
      "type": "comment",
      "id": "63003537",
      "is_reply_comment": true,
      "message": "Reply message",
      "created_by": {
        "type": "user",
        "id": "221860571",
        "name": "Name",
        "login": "login@gmail.com"
      },
      "created_at": "2015-04-14T17:49:07-07:00"
    }
  ]
}