You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello!
I am trying to add an in-line comment using the REST API. Google pointed me to the following request format, however this fails with an error (see response).
Also, I am guessing at what to put in serializedHighlights, (it is flagged in the error response if not present in the request) so if anyone knows anything about that, I'll be pleased to receive advice on that!
I haven't looked at the code yet.
Here's the outgoing request:
POST {{server}}/rest/api/content { "type": "comment", "mode": "create", "container": { "id": "2031625", "type": "page" }, "body": { "storage": { "value": "<p>This inline comment added from REST API</p>", "representation": "storage" } }, "extensions": { "location": "inline", "inlineProperties": { "numMatches": 1, "originalSelection": "Hello From me", "matchIndex": 0, "serializedHighlights" : "[[\"Hello From me\"]]" } } }
And the error response:
{ "statusCode": 400, "data": { "authorized": true, "valid": false, "errors": [ { "message": { "key": "lastFetchTime", "args": [] } } ], "successful": false }, "message": "Could not create content with type comment" }
Regards,
Chris
Community moderators have prevented the ability to post new answers.
Hi, Chris.
So, I was having the same issue and then I realized it was complaining about the a missing 'lastFetchTime' attribute. I'm not sure what it is exactly, it seems to be the date where it was last fetched. After some tests, I found out it is a date represented as a timestamp (so, a long integer).
I generated one using http://www.epochconverter.com/.
This worked for me:
... "extensions": { "location": "inline", "inlineProperties": { "numMatches": 1, "originalSelection": "Hello From me", "matchIndex": 0, "serializedHighlights" : "[[\"Hello From me\"]]", "lastFetchTime":"1487711412" ...
I hope this helps.
Kind regards,
Jaime Kirch da Silveira
Atlassian Cloud Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.