Confluence API of Page Properties Macro

SergioC September 17, 2014

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

 

Thanks!.

 

 

2 answers

1 vote
Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 18, 2014

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

0 votes
Tiago Comasseto
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 17, 2014

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 18, 2014

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

SergioC September 18, 2014

Thank you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events