Document APIs

Documents

Below are the available APIs for working with Documents in Ovation.

Using our REST API to Get Documents

The Get Documents (limit 5000 per page) and related data request is an HTTP GET call to the following urls:

Required data from Ovation

The following data must be provided by Ovation in order to call the API.  Different values must be configured for staging and production

  • authorization token

Example of request:

/api/v3/documents?organizationId=123&folderName=Raw Data&startDate=2021-01-01&endDate=2021-01-26

Query Parameters

key

required

description

projectTemplateId yes Project Template for requisition documents.
requisitionId optional Gets documents just for this requisition ID.
requisitionIdentifier optional Gets documents just for this requisition Identifier.
folderName optional Document folder to query.
startDate yes Starting date for query.
endDate yes Ending date for query.
page optional Page number being requested. Defaults to page 1 if not supplied.
perPage optional Number of documents to return per page. Maximum of 5000 and defaults to 5000 if not supplied.


Response

{
    "documents": [
        {
            "id": 1,
            "name": "test1.pdf",
            "requisitionId": 10,
            "requisitionIdentifier": "REQ-1",
            "downloadLink": "https://...",
            "createdAt": "2021-01-25T22:06:21.000Z",
            "uploadLink": null
        },
        {
            "id": 2,
            "name": "test2.pdf",
            "requisitionId": 11,
            "requisitionIdentifier": "REQ-2",
            "downloadLink": "https://...",
            "createdAt": "2021-01-25T22:06:21.000Z",
            "uploadLink": null
        }
    ],
    "meta": {
        "currentPage": 1,
        "perPage": 5000,
        "totalEntries": 11
    }
}<br>

Using our REST API to Create a Document

The Create Document request is an HTTP POST call to the following urls:

Create Document Payload

{
    "document": {
        "requisitionId": int,
        "requisitionIdentifier": "string",
        "projectTemplateId": int,
        "folderName": "string",
        "fileName": "string",
        "fileContent": "base64 string",
        "returnUploadLink": boolean
    }
}

Field name

Required

Description

requisitionId optional ID of requisition document is associated with. Used instead of requisitionIdentifier and projectTemplateId.
requisitionIdentifier optional Requisition Identifier. (Must supply projectTemplateId when using this field)
projectTemplateId optional Project template associated with requisition identifier.
folderName yes Folder document will be added too.
Options:
  • Raw Data
  • Supplemental Documents
  • Rejected Documents
  • Supporting Documents
  • Complete Reports
  • Incomplete Reports
fileName yes Name of document to be added.
fileContent optional Base64 content of file (only used if not requesting upload link).
returnUploadLink optional Link to upload file to S3 (only used if not sending fileContent).
If uploading file to S3 make sure it matches fileName supplied.


Create Document Response

The Create Document Endpoint API call can return the following possible responses:
Response code Response body
201 “Indicating the resource was successfully created”
{
    "document": {
        "id": 1234,
        "name": "filename.pdf",
        "requisitionId": 321,
        "requisitionIdentifier": "abc-0",
        "downloadLink": "",
        "createdAt": "date",
        "uploadLink": "https://...."
    }
}
		
401 “Indicating an authentication error”  
422 “Validation error, indicating an error with the request contents” Will return the validation errors found.
e.g. "fileName required."
       "Folder Name invalid or not found."
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.