Query the newly created projectdoc space for its properties. To build such a query you need the space key of the space. Just choose "Overview" of the "Space tools" actions and retrieve it from the overview page. Another option is to use the following JavaScript command in the console of your browser: AJS.params.spaceKey Note Box |
---|
This tip addresses all Web API Extension versions since 1.0. Starting with Version 1.1 it is mandatory to use the request parameter expand=property to retrieve properties. For older versions this property does not exist. |
Now let us use this page ID in your first query: Code Block Placeholder |
---|
code-theme | Midnight |
---|
code-language | Bash |
---|
code-title | Query the properties of a projectdoc document |
---|
| curl -s --cookie /tmp/confluence.cookie \
https://www.example.com/confluence/rest/projectdoc/1/space/home.json?expand=property | jq. |
Here you can see the response: Code Block Placeholder |
---|
code-theme | SpaceDefault |
---|
code-language | Bash |
---|
code-title | Response |
---|
| {
"id": 950274,
"property": [
{
"source": "IDX",
"name": "Categories",
"value": ""
},
{
"source": "IDX",
"name": "documentation-json-uri",
"value": "https://www.smartics.eu/confluence/download/attachments/12156954/docmap.json?api=v2"
},
... |
Besides JSON you can also get the response as XML. Just omit the extension or use .xml as extension: Code Block Placeholder |
---|
code-theme | Midnight |
---|
code-language | Bash |
---|
code-title | Query the properties of a projectdoc document (xml) |
---|
| curl -s --cookie /tmp/confluence.cookie \
https://www.example.com/confluence/rest/projectdoc/1/space/home?expand=property | xmlstarlet format --indent-tab
or
curl -s --cookie /tmp/confluence.cookie \
https://www.example.com/confluence/rest/projectdoc/1/space/home.xml?expand=property | xmlstarlet format --indent-tab |
Code Block Placeholder |
---|
code-theme | SpaceDefault |
---|
code-language | Bash |
---|
code-title | Response (xml) |
---|
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<space id="950274">
<property>
<source>IDX</source>
<name>Categories</name>
<value/>
</property>
<property>
<source>IDX</source>
<name>documentation-json-uri</name>
<value>https://www.smartics.eu/confluence/download/attachments/12156954/docmap.json?api=v2</value>
</property>
... |
|