You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Next »
Provides access to projectdoc documents via a web API.
Provides access to projectdoc documents. The service allows to fetch representations by queries and by document identifiers.
REST API Browser
Use the REST API Browser of Confluence to start using the REST API provided by projectdoc.
The browser is accessible via plugins/servlet/restbrowser
. For more information please refer to Using the REST API Browser.
Examples
Here are some typical scenarios using these services.
Query Documents
The API allows to execute queries similar to the Display Table Macro.
https://username:secret@example.com/confluence/rest/projectdoc/1/document.xml?
select=Name,Short%20Description&
from=SPACEKEY&
where=Doctype=blank
The result is a representation that provides a list of all document IDs. In this example, three documents are returned.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<documents
id-list="753671,753673,753675"
max-result="3"
start-index="0"
size="3">
<document id="753671">
<property>
<name>Name</name>
<value>Blank 1</value>
</property>
<property>
<name>Short Description</name>
<value>Short description 1.</value>
</property>
</document>
<document id="753673">
<property>
<name>Name</name>
<value>Blank 2</value>
</property>
<property>
<name>Short Description</name>
<value>Short description 2.</value>
</property>
</document>
<document id="753675">
<property>
<name>Name</name>
<value>Blank 3</value>
</property>
<property>
<name>Short Description</name>
<value>Short description 3.</value>
</property>
</document>
</documents>
If max-result=1
is added as parameter to the request, only the first hit in the result set is returned. Clients may then forward the id-list
and select the documents to return. There are also links in the HTTP header to request the next (rel=next
) or previous (rel=prev
) hit.
Fetch by ID List
Once a list of document IDs is returned, the client my select documents from that list.
https://username:secret@example.com/confluence/rest/projectdoc/1/document.xml?
select=Name,Short%20Description&
id-list=753671,753673,753675&
max-result=1&
start-index=1
With this request, the document with ID 753673 is returned.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<documents
id-list="753671,753673,753675"
max-result="1"
start-index="1"
size="3">
<document id="753673">
<property>
<name>Name</name>
<value>Blank 2</value>
</property>
<property>
<name>Short Description</name>
<value>Short description 2.</value>
</property>
</document>
</documents>