hi, i want to update my confluence page created via postman.
i get the below details from the website
in the below what is ID? is that the page ID? which we get from Page Information
curl -u admin:admin -X PUT -H 'Content-Type: application/json' -d '{"id":"3604482","type":"page", "title":"new page","space":{"key":"TST"},"body":{"storage":{"value": "<p>This is the updated text for the new page</p>","representation":"storage"}}, "version":{"number":2}}' http://localhost:8080/confluence/rest/api/content/3604482 | python -mjson.tool
Dear @Leeooos ,
yes: 3604482 is the page ID of the page you want to update. Don't forget to increase the version number by one (current page version = 2, then new version = 3).
For what is that "python "mjson.tool"? The curl request doesn't require this.
So long
Thomas
when i tried to put a content with the below command
{"id":"169052728","type":"page",
"title":"NewPage","space":{"key":"TST"},"body":{"storage":{"value":
"<p>This is the updated text for the new page</p>","representation":"storage"}},
"version":{"number":2}}
i get the folllowing response. can you please help on this
{
"statusCode": 400,
"data": {
"authorized": true,
"valid": false,
"errors": [
{
"message": {
"key": "You can't change an existing page's space.",
"args": []
}
}
],
"successful": false
},
"message": "Could not update Content of type : class com.atlassian.confluence.pages.Page with id 169052728"
}{
"statusCode": 400,
"data": {
"authorized": true,
"valid": false,
"errors": [
{
"message": {
"key": "You can't change an existing page's space.",
"args": []
}
}
],
"successful": false
},
"message": "Could not update Content of type : class com.atlassian.confluence.pages.Page with id 169052728"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear @Leeooos ,
I have no clue about this error message, but in your request there is the parent page missing. This is not documented and was one year ago required to create and update pages.
{"id":"169052728","type":"page",
"title":"NewPage", "ancestors": ["id":"<the parent page id>"],"space":{"key":"TST"},"body":{"storage":{"value":
"<p>This is the updated text for the new page</p>","representation":"storage"}},
"version":{"number":2}}
No guarantee, but for me this worked.
So long
Thomas
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.