I've seen posts about "'metadata': { 'properties': { 'content-appearance-draft': { 'value': 'full-width' }, 'content-appearance-published': { 'value': 'full-width' } }" but I think this only relates to deprecated Content API
I also see users can set the default to "full width" on creating new pages... and this ALMOST works: when i create manually it works, but when i create with API it is still initially "small", but when i edit it it automatically goes to full width... assumedly the "draft" behind it is being set to full width but not the published version? With 6000 pages to create this isn't really an option
Maybe it is too late, anyway I was able to apply full-width by POST on:
https://sitti.atlassian.net/wiki/api/v2/pages/[PAGE-ID}/properties
with body:
awesome, thanks a million @Matteo Ferrari - I was desperately searching for this solution for days!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Stefan Draber can you please help to get full page working via post. where to use the below clause
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
disclaimer: all this full-width stuff didn't make it in my final script, so all of the following is the result of the last hour me trying to reproduce it 😉
The following examples have existing pages as prerequisites. I don't remember whether I was able to create a page in full-width.
POST only works if you didn't set the page width in your page yet (= the property doesn't exist yet, POST creates a new one)
My POST request would look like this:
curl --location 'https://******.atlassian.net/wiki/api/v2/pages/1225392688/properties/' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"key": "content-appearance-published",
"value": "full-width"
}'
If you already set a page width on the page in question, you first have to get the ID of this "content-appearance-published" property (https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-content-properties/#api-pages-page-id-properties-get) and then update the property via PUT.
My PUT request would look like this:
curl --location --request PUT 'https://******.atlassian.net/wiki/api/v2/pages/1225687374/properties/1225032267' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"key": "content-appearance-published",
"value": "fixed-width",
"version": {
"number": 2,
"message": "Test"
}
}'
Hope that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Stefan Draber thanks for your reply but still not creating the page with full width. here is my first post via REST API V2/pages
{
"spaceId": "1234",
"status": "current",
"title": "1234",
"parentId": "1234",
"key": "content-appearance-published",
"value": "full-width",
"body": {
"representation": "storage",
"value": "<p>new page</p>"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
as I said, my API request examples were aiming at changing existing pages to full-width, as this is what Matteo pointed at in his original post.
I think what I did back then was to first create the page with one API request and then update the the page properties to full-width in a seperate API request.
Here you'll find an example request, where you seemingly can put the page-width property into the creation request, but it uses the (deprecated) POST content endpoint, not the current POST page endpoint. I didn't try it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it worked.
simple use the following - in 2 different POST web request.
https://sitti.atlassian.net/wiki/api/v2/pages/[PAGE-ID}/properties
{
"key": "content-appearance-draft",
"value": "full-width"
}
{
"key": "content-appearance-published",
"value": "full-width"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
+1 I'm looking for the same answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.