您如何使用他们的REST API向Atlassian合流发布评论?

Edw*_*ard 2 rest confluence confluence-rest-api

我正在尝试使用REST API将评论自动添加到页面中。

我正在使用邮递员进行测试,即时通讯指向以下网址:https://############.atlassian.net/wiki/rest/api/content/

使用有效的标题,并发布以下json:

{  
    "type":"comment",
    "container":"72025106",
    "body":{  
        "storage":{  
            "value":"auto comment 1",
            "representation":"storage"
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

当我这样做时,我会得到此错误:

{
    "statusCode": 500,
    "message": "java.lang.IllegalStateException: Must provide id and type for Content"
}
Run Code Online (Sandbox Code Playgroud)

小智 5

这应该工作:

{"type":"comment",
   "container":{
       "id":"[PARENT_ID]",
       "type":"page",
       "status":"current"
   },
   "body":{
      "storage":{
         "value":"[COMMENT_BODY]",
         "representation":"storage"
      }
   }
}
Run Code Online (Sandbox Code Playgroud)