Identifying and Downloading Project Documents by Using the Project Document Management API

This topic explains how you can use the Project Document Management API to search for project documents, view the properties of a project document, and download specific project documents.

Context

Using the Project Document Management API, you can:
  • Search project documents using the document title, the last modified date, the document type, or a combination of any of these filtering options. For example, you can search for ContractTerms modified on 2020-02-27 by specifying the document type and the last modified date as the filtering criteria.

  • View the list of all the documents, along with the associated metadata, in a project or folder, or the properties of a specific document if you know its document ID.

  • View details of the signed document associated with the original document sent for signature as part of the signature task. At the project or folder level, the API enables you to get details of the signed document associated with each document in the project or the folder.

  • Download project documents using the corresponding document ID.

Procedure

  1. To search for project documents, use the GET /projectDocuments endpoint as follows:
    GET {{runtime_url}}/projectDocuments?$select=title,projectID,owner&$filter=title eq {}and documentType and {<documentype>}and lastModifiedDate eq {<yyyy-MM-dd>}&$top=<number>&$count=<true|false>&$skip=0&user=<username>&passwordAdapter=<PasswordAdapterName>&realm=<realm>
    Where:
    $select
    Specify the document metadata that you want to be retrieved for the documents that meet the specified search criteria. You can specify any of the following metadata elements:
    • name, version,parentFolderId, projectId, owner, lastModifiedDate, creationDate, documentType, active, status
    $filter
    Specify one or more of the search criteria. You can use the and condition to combine multiple criteria.
    • LastModified–Specify the last modified date along with one of the following operators: gte (greater-than or equal), lte (lesser-than or equal), gt (greater-than), lt (lesser-than), or eq (equals).

    • DocumentType–Specify the type of the document with an eq operator. Supported values are:
      • ContractAddendum, MainAgreement, CleansheetDocument, LineItemDocument, ContentDocument, Event, SavingsForm, AssembledPDF, AnalyticalReport, CompoundReport, ContractClause, ProfileQuestionnaire, Scorecard ContractTerms
    $top

    Specify the number of results to be included in one page of the response. The default and maximum allowed results are 500. For example, $top=10.

    $skip
    Specify the number of documents to be skipped (offset) from the beginning of the result set for uses such as pagination. The default setting is 0. You can use the $skip parameter to view a particular page. For example, if $top=10 and $skip=30, the query directly loads the fourth page of results.
    $count
    Specify whether the total number of matching results be displayed along with the results. Supported values are TRUE and FALSE.

    A list of documents that match the specified search criteria, along with the document properties you specified for the $select parameter, is returned.

  2. To view all the documents associated with a project ID or folder ID, use the GET /projectDocuments/documentID endpoint as follows:
    GET {{runtime_url}}/projectDocuments/documentID?user=username&passwordAdapter=PasswordAdapterName&realm=realm
                      

    Where documentID denotes the project ID or the folder ID.

  3. Review the results to identify the document that you want to download.

    Documents that have a signed document associated with them will have the ID of the signed document populated in the signedDocumentId field.

  4. To download a document from a project or workspace, use the GET /projectDocuments/documentId/files endpoint as follows:
    GET {{runtime_url}}/projectDocuments/documentID/files?user=username&passwordAdapter=PasswordAdapterName&realm=realm
                      
    Where documentID denotes the document ID of the file that you want to download. While downloading a signed document associated with a document, the documentID denotes the signed document ID of the file that you want to download.

    The specified document is downloaded.