Confluence API of Page Properties Macro

It's possible get the properties added in Page Properties Macro of a Page via REST API?

 

Thanks!.

 

 

2 answers

1 vote
Davin Studer Community Champion Sep 18, 2014

You could, but I think you will have to parse the page and insert it that way.

Hi Sergio, you may want to check this doc to see if it's what you're trying to achieve. I've added a custom property using the example JSON and it worked:

$ curl -D- -u admin:admin -X POST --data "{\"key\":\"example-property-key\",\"value\":{\"anything\":\"goes\"},\"content\":{\"id\":\"360456\",\"type\":\"page\",\"_links\":{\"self\":\"http://192.168.10.224:8561/rest/api/content/360456\"},\"_expandable\":{\"body\":\"\",\"container\":\"\",\"ancestors\":\"\",\"children\":\"\",\"descendants\":\"\",\"metadata\":\"\"}},\"version\":{\"number\":2,\"minorEdit\":false},\"_links\":{\"base\":\"http://192.168.10.224:8561\",\"context\":\"\",\"self\":\"http://192.168.10.224:8561/rest/api/content/360456/property/example-property-key\"}}" -H "Content-Type: application/json" http://192.168.10.224:8561/rest/api/content/360456/property
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-ASEN: SEN-L3897800
Set-Cookie: JSESSIONID=CF1289EE83FD4FBD3772C34DEB65CB9D; Path=/; HttpOnly
X-Seraph-LoginReason: OK
X-AUSERNAME: admin
X-Content-Type-Options: nosniff
Content-Type: application/json
Transfer-Encoding: chunked
Date: Tue, 09 Sep 2014 14:04:24 GMT

{"id":"360457","key":"example-property-key","value":{"anything":"goes"},"version":{"when":"2014-09-09T11:04:24.136-0300","message":"","number":1,"minorEdit":false},"_links":{"base":"http://192.168.10.224:8561","context":"","self":"http://192.168.10.224:8561/rest/api/content/360456/property/example-property-key"},"_expandable":{"content":"/rest/api/content/360456"}}

Cheers

Davin Studer Community Champion Sep 18, 2014

He is referring the page properties macro, not content properties.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

1,592 views 4 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you