Using postman to call the wiki/rest/api/content api to create a new page with the body (with Content-Type: application/json) below, I receive this message:
"message": "java.lang.RuntimeException: com.atlassian.confluence.content.render.xhtml.XhtmlException: com.atlassian.confluence.content.render.xhtml.XhtmlException: Missing required attribute: {http://atlassian.com/resource/identifier}username"
even though it matches the example in the "Create a page with a task" section of https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/
After searching the api doc as well as google, I can't figure out why it doesn't work. Obviously, abc@example.com is just the example. In the real post, it was a known valid user email address/login.
Body in POST
{
"type" : "page",
"status" : "current",
"title" : "TEST1: Page created through postman",
"space" : { "key" : "EIE" },
"ancestors": [{
"id": 281611148
}],
"body" : {
"storage" : {
"representation" : "storage",
"value": "<ac:task-list>\n<ac:task>\n<ac:task-status>incomplete</ac:task-status>\n<ac:task-body>\n<ac:link><ri:user ri.username='abc@example.com' /></ac:link>\nTest action created for Tom\n</ac:task-body>\n</ac:task>\n</ac:task-list>"
}
}
}