I’m trying to figure out how to create comments/annotations via API.
According to the documentation it should be something like curl --request POST 'https://my.xwiki.domain/xwiki/rest/wikis/xwiki/spaces/MySpace/spaces/PageName/pages/WebHome/comments?text=Test' --header 'Content-Type: application/x-www-form-urlencoded' --header 'Authorization: Basic *****'
But it always replies with ‘Invalid or missing form token.’
But annotations endpoint is not documented.
I tried to do the PUT request with form parameters annotation=Test&selectionLeftContext=30&selectionRightContext=40
but it was not succeeded.
An annotation is a comment that provides values for 3 fields: Selection, Target and State. You can see the difference if, on the same page, you add a comment and an annotation and check the page in object mode.