jbevan
1
We’ve tried this payload to the API documented here https://developer.atlassian.com/cloud/confluence/rest/#api-content-post:
{
body: {
view: {
"representation": "string",
"value": "some comment"
}
},
space: { key: "EXAMPLE" },
type: "comment",
ancestors: [{
id: 1234
}]
}
but we get a response saying that a container property needs to be sent in the payload too but that doesn’t appear to be documented anywhere…
1 Like
Hi @jbevan,
Seems like a gap in the documentation. I was able to create a comment by adding a container like this:
{
"type": "comment",
"space": {
"key": "test2"
},
"body": {
"storage": {
"representation": "storage",
"value": "<p>A new comment</p>"
}
},
"title": "Test comment",
"container": {
"id": 10649626,
"type" : "global"
}
}
As for the container object, this might help describe it a bit:
{
"additionalProperties": false,
"description": "The new content to add the comment to.",
"properties": {
"id": {
"description": "The `id` of the parent content.",
"type": "string"
},
"type": {
"description": "The content type.",
"type": "string"
}
},
"required": ["id", "type"],
"type": "object"
}
Also, I reported this (Log in with Atlassian account) by clicking the “Give docs feedback” link on the upper right hand corner of the page.
Hope this helps.
Ian
6 Likes
iragudo
5
Hello @VictorDragnea, the parent content should be the contentId
of the content you want to comment to.
2 Likes
Figured it out. Thank you!
1 Like
ibuchanan
Split this topic
7
A post was split to a new topic: Add nested comments via REST