I'm trying to update a page. while running the curl request it gives me an error
BadRequestException: A page with this title already exists: A page already exists with the title
Code:-
echo '{"id":"xxxxxx","type":"page","title":"'${releaseVersion}'","space":{"key":"~xxxxxx"},"body":{"storage":{"value":"'$TEXT'","representation":"storage"}},"version":{"number":'$PAGE_VERSION'}}' > update1.json
curl -u 'xxxxxx@xxxxxx.xxxx:xxxxxxx' -X PUT -H 'Content-Type: application/json' -d '@update1.json' https://xxxxxx.xxxxx.net/wiki/rest/api/content/xxxxxxx | python -mjson.tool
rm update1.json
If I change the title to something NEW it creates a NEW PAGE. However, I don't want a new page, I want to update the same page.
If you want to update the same page, you need to increment the version number, see https://developer.atlassian.com/cloud/confluence/rest/api-group-content/#api-wiki-rest-api-content-id-put .
Hi Marc,
I'm incrementing the version by 1. However, I keep the title as same.
"title":"'${releaseVersion}'"
Keeping the title as the same gives an error that the page already exists.
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.