4

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

我正在使用 Postman 进行测试,我指向这个网址:https://###########.atlassian.net/wiki/rest/api/content/

使用有效的标头,并发布此 json:

{  
    "type":"comment",
    "container":"72025106",
    "body":{  
        "storage":{  
            "value":"auto comment 1",
            "representation":"storage"
        }
    }
}

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

{
    "statusCode": 500,
    "message": "java.lang.IllegalStateException: Must provide id and type for Content"
}
4

1 回答 1

6

这应该工作:

{"type":"comment",
   "container":{
       "id":"[PARENT_ID]",
       "type":"page",
       "status":"current"
   },
   "body":{
      "storage":{
         "value":"[COMMENT_BODY]",
         "representation":"storage"
      }
   }
}
于 2015-05-21T06:40:43.270 回答