Projjex API

Document Methods
Overview

The document methods allow you to attach documents to any project or item.

The standard XML and JSON representations of a document is shown below. These are returned by many of the methods below, except where otherwise indicated.

Sample Data Responses
<Document DocumentID="3" Name="contract.doc">
    <ProjectID>1234</ProjectID>
    <ItemID>82</ItemID>
    <AddedBy>CDA</AddedBy>
    <CreatedOn>2008-02-25</CreatedOn>
    <Size>492</Size>
</Document>
Sample JSON Responses
handleProjjexData({ "Document": {"CreatedOn": "2008-02-25", "DocumentID": "3", "ItemID": "82", "Size": "492", "Name": "contract.doc", "AddedBy": "CDA", "ProjectID": "187" }, {"CreatedOn": "2008-02-27", "DocumentID": "4", "Size": "214", "Name": "Projjex20080227-01.jpg", "AddedBy": "CDA","ProjectID": "1234" }});
Methods
List Documents
URL: http://api.projjex.com/documents/listdocuments/
Overview
Returns a list of documents in the specified project. If the document is attached to the project then no ItemID value will be returned, otherwise the ItemID value will refer to the item the document is attached to.
Parameters
Name Description Required
Session Session token received when logging in. Yes
ProjectID The unique identifier of the project. Yes
Example
http://api.projjex.com/documents/listdocuments/?Session=UJ0X23LRZPR1AFX5YKF4&ProjectID=1234
Sample XML Response
<Documents>
    <Document DocumentID="3" Name="contract.doc">
        [contents of the Document nodes are the same 
        as shown at the top of this page]
    </Document>
</Documents>
Sample JSON Response
handleProjjexData({ "Documents": { "Document": [ { ... }, { ... } ] }});
Download
URL: http://api.projjex.com/documents/download/
Overview
Retrieves the contents of a document.
Parameters
Name Description Required
Session Session token received when logging in. Yes
ProjectID The unique identifier of the project. Yes
DocumentID The unique identifier of the document. Yes
Example
http://api.projjex.com/documents/download/?Session=UJ0X23LRZPR1AFX5YKF4&ProjectID=1234&DocumentID=1
Response
The server will respond with the contents of the documents. There is no XML or JSON output for this method - only the exact bytes of the document are returned.
Attach
URL: http://api.projjex.com/documents/attach/
Overview
Uploads and attaches the specified document. The request must be sent as a "multipart/form-data" post, with the document sent with the request.
Parameters
Name Description Required
Session Session token received when logging in. Yes
ProjectID The unique identifier of the project. Yes
ItemID The unique identifier of the item you want to attach the document to. If no ItemID is specified, the document is attached to the project. No
Response
The server will respond with an updated list of documents within the project. See the List Documents method for a sample response.
Update Document
URL: http://api.projjex.com/documents/updatedocument/
Overview
Adds a new version of a document. The original document will still remain on the server.
Similar to the Attach method, this needs to be sent as a "multipart/form-data" post, with the document sent with the request.
Parameters
Name Description Required
Session Session token received when logging in. Yes
ProjectID The unique identifier of the project. Yes
DocumentID The unique identifier of the document you want to update. Yes
Response
The server will respond with an updated list of documents within the project. See the List Documents method for a sample response.
Delete Document
URL: http://api.projjex.com/documents/deletedocument/
Overview
Deletes a document. This action cannot be undone.
Parameters
Name Description Required
Session Session token received when logging in. Yes
ProjectID The unique identifier of the project. Yes
DocumentID The unique identifier of the document to delete. Yes
Response
The server will respond with an updated list of documents within the project. See the List Documents method for a sample response.
Quick Links
Support

.NET developers can download our .NET API Wrapper. The wrapper simplifies using the Projjex™ API by returning .NET objects.

API Methods