attachments

Description

This operation lists the attachments associated with an entity.

URI

GET lists the attachments
http://ws.planzone.com/v1/rest/attachments

Formats

xml, json

Requires Authentication (about authentication):

yes

Requires Authorization (about authorization):

The application must have the 'read' permission granted from the Planzone.

The attached entity must be in a project that is visible by the user.

The attachment file must be in a folder that is visible by the user.

API rate limited (about rate limiting):

true

Parameters

NameOptionalDescription
entityNOList the attachments which are associated with the given entities. The parameter defines a list of todo GUID separated by a comma (,). At least one todo must be defined.

Request Example

The following request:

GET /v1/rest/attachments?entity=B23DC

lists the attachments of the todo B23DC.

Response

The response contains one attachment XML element for each attachment.

<attachment id="JwLC23" type="image" document="DAOU6KI4"> <title>Document title</title> <name>my-document.png</name> <mime-type>image/png</mime-type> <width>300</width> <height>400</height> <size>12344/size> <author id='AI23' status='active'> <name>John Jackson</name> <email>jj@gmail.com</email> </author> <url>https://storage.planzone.com/storage/doc/7d1e.1e3fc4.70926ed.POAWaR!ga7B2jZ9re2Dr9BcygDA</url> </attachment>

The type attributes indicates the type of the document attached to the entity:

wiki
The document is a wiki page.
image
The document is an image.
audio
The document is an audio file.
video
The document is a video file.
file
The document is a file.
google-doc
The document is a Google Doc document.
empty
The document has no associated content.

For a wiki attachment, a wiki attribute indicates the unique id of the wiki page. The content of the wiki page must be retrieved through the wiki API call.

For other type of attachments, a document attribute indicates the unique id of the document.

The width, height XML elements are provided only if the attachment is an image.

The url is an URL that can be used to download, preview or upload a new version of the attachment. This URL is valid only 24 hours. The desired action are made by appending the following prefix to that URL:

urlget
Download the document
urlview
View the document
urlpreview
View a preview of the image.
urlput
Upload a new version of the document

The url element is not present if the attachment is a wiki page, a Google Document, or the document has no version yet.

HTTP Status Codes

200 OK Operation succeeded

See also

todos
attachments/create
attachment XML element
wiki