Can I do a PUT Request to Confluence API without having the version number updated?
This is JSON I sent:
"title": "Does it work?",
"value": "<p>This is just TEXT I want to add</p>",
I want to increment the version counter automatically by one, because I will not know which version is next.
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.
Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events