Hi,
Quick question:
Can I do a PUT Request to Confluence API without having the version number updated?
This is JSON I sent:
{
"version": {
"number": 6
},
"title": "Does it work?",
"type": "page",
"body": {
"storage": {
"value": "<p>This is just TEXT I want to add</p>",
"representation": "storage"
}
}
}
I want to increment the version counter automatically by one, because I will not know which version is next.
Hi Adrian,
Thanks for reaching out to Atlassian community.
I have been looking into your question and can confirm the version number is a required parameter of the JSON request, so you would not be able to have confluence auto increment the version.
The only workaround I can suggest to this is to use the GET content REST API call to retrieve the current version number.
Here is an example curl command:
curl -D- -u $userName:$passWord -X GET -H "Accept: application/json" https://$confluenceInstanceUrl/rest/api/content/$contentId?expand=version
This could be worked into a script in which you extract the version from the JSON response, increment that by 1 and feed it into the JSON of your PUT command.
I hope this helps somewhat even though it's not exactly what you were looking for.
Let us know if there is anything else.
Thanks,
Nero
[Removed double post]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.