Retrieving signed documents
Once a case file has reached the completed status (status code 5), the final, signed documents are ready for download.
Retrieving these signed documents is a two-step process: first, you must identify the Document IDs within the case file, and then you use those IDs to download the content.
Using the API
Step 1: Retrieve document IDs from the case file details
The unique identifiers (documentIds) required for downloading the content are found within the details of the completed case file. Depending on your integration set-up you might already have stored the document IDs. If not, you can fetch the complete details of any case file using the following endpoint:
// GET case file details
GET <<penneo_api_base_url>>/casefiles/<casefile id>
The response for this request will contain a list of documents associated with the case file. You must parse this response to extract the document IDs for all documents you need to download.
Step 2: Download the document content
Once you have the documentId, you can call the dedicated content endpoint to download the file.
The endpoint used for downloading the document content is:
// GET Document
GET <<penneo_api_base_url>>/api/v3/documents/{documentId}/content
Important Notes:
- URL Version: Be sure to use the correct API version, /api/v3/ for the document content endpoint.
- Content Type: The response will include a Content-Type header (application/json) and you receive the signed document as a base64 encoded PDF which you must decode.
- Case file status: Ensure the case file has a status '5' completed before downloading the signed documents. While documents may exist in other states, attempting to download content for an incomplete case file may return an version yet to be signed by others.
Updated 17 days ago
