Hi all! I am attempting to update the content of a page using REST api.
I am calling this endpoint using PUT: http://domain/wiki/rest/api/content/3906240556
With this payload:
{ "id": 3906240556, "type": "page", "space": { "key": "PK" }, "body": { "title": "NEW TITLE", "storage": { "value": "test test test", "representation": "storage" } }, "version": { "number": 5 }}
I get a response "200 OK", but nothing is actually updated on the page itself. I can't figure out why that is. Does anyone have any pointers as to what might be the issue?
Hi @Søren Dahl Poulsen
Welcome to the Atlassian Community!
I have tried the same endpoint you used, but if my title is inside the body for example, it doesn't allow me to update and there is no 200 OK for me.I'm following this documentation REST API - Update commentSo, I'd like to ask you to test running something like this, when trying to update the page:
{"version": {"number": 5},"type": "page","status": "current","title": "NEW TITLE","space": {"key": "PK"},"body": {"storage": {"value": "test test test","representation": "storage"}}}
That should do the trick!If that still doesn't work, would you mind sharing the body response?Also, keep in mind to use https:// instead of http://
Cheers,Jessica
Hi Jessica
I am fighting with the same problem like @Søren Dahl Poulsen
The title will be updated, but the value (page content) is not changing?
Could you please check again on your side.
Here is my Body:
{"version": {"number": 11},"type": "page","status": "current","title": "New page update by API","storage": {"value": "test daniel","representation": "storage"}}
The value has no function?
BR
Daniel
Hi @Daniel Schmidt
The value has function and I can confirm to you it works, but in your case, it seems it is not really inside the body, like in the example above or in the REST API - Update comment documentation examples, so this seems what is going wrong there.
From what I can see, the storage and value, should be after the body, which there isn't any in your example.Could you try this one?
{"version": {"number": 12},"title": "New page update by API","type": "page","body": {"storage": {"value": "test daniel","representation": "storage"}},}
Hope this helps.Jessica
@Jessica Moving title outside of body and adding using "https" did the trick for me. Thanks!
It looks like you're new here. Sign in or register to get started.