Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Document Properties Marker
overridefalse
 
Short DescriptionProvides access to projectdoc documents via a web API. 
Doctypeaddon-componenthide
NameDocument Resource 
Parent
Parent Property
property-nameName
 
Audience
Name List
render-no-hits-as-blanktrue
addon-componentrole
propertyAudience
 

Type

Name List
doctypeaddon-component-type
render-no-hits-as-blanktrue
namesREST Resource
propertyType

 
Subject
Name List
doctypesubject
propertySubject
 

Categories
Name List
doctypecategory
propertyCategories
 

Tags
Tag List
propertyTags
 
Iteration

Iteration
value

filled

finished

hide
ExtensionWeb API ExtensionPathrest/projectdoc/1/document 
Since1.0
Path

Parent Property
parent-doctypetopic
add-linkfalse
property-namePath
/document


Deprecatedhide
Removedhide
Sort Keyhide

...

Section
titleExamples

Here are some typical scenarios using these services.

Section
titleQuery Documents

The API allows to execute queries similar to the Display Table Macro.

Code Block
languagetext
titleQuery Request
https://username:secret@example.com/confluence/rest/api/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.

Code Block
languagexml
titleReturned Representation
<?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.

Note Box

If the ID list is specified in the request, no query is executed. Only the select parameter will be taken into account to select on the returned document properties.

Section
titleFetch by ID List

Once a list of document IDs is returned, the client my select documents from that list.

Code Block
languagetext
titleID List Request
https://username:secret@example.com/confluence/rest/api/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.

Code Block
languagexml
titleReturned Representation
<?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>

...