Description
Allows retrieval of PDF reports for a completed Order/Job
Key Features
- Request a list of available reports for an Order/Job
- Receive a Download link to retrieve available reports
Get a List of Reports
Testing: GET https://cat-api.hill-laboratories.com/client/api/v3/orders/{orderId}/reports
Production: GET https://api.hill-laboratories.com/client/api/v3/orders/{orderId}/reports
Download Specific Report
Testing: GET https://cat-api.hill-laboratories.com/client/api/v3/orders/{orderId}/reports/download/{reportHashId}
Production: GET https://api.hill-laboratories.com/client/api/v3/orders/{orderId}/reports/download/{reportHashId}
Required Headers
“Authorization”, “Bearer Add Your Authentication Token here“
Use Case Example
Below describes an example of how to utilize these endpoints:
1. Get List of Reports
For example Order ID 8066, pass the appropriate URL (e.g. GET https://api.hill-laboratories.com/client/api/v3/orders/8066/reports) with a valid bearer token.
Example of returned result:
{
"reports": [
{
"name": "Standard PDF Report",
"approvedAt": "2021-08-04T20:38:27.762Z",
"isFinal": true,
"version": "6.2",
"downloadUrl": "https://api.hill-laboratories.com/client/api/v3/orders/1/reports/download/V6meRH"
}
]
}
2. Download Report
Pass the provided “downloadUrl” to the API (e.g GET https://api.hill-laboratories.com/client/api/v3/orders/1/reports/download/V6meRH) with a valid bearer token.
An appropriate file should be sent.
Possible Responses
Code | Description | When |
---|---|---|
200 | 200 OK | The request completed OK and a report PDF is returned |
400 | 400 Bad Request | Incorrect request. Includes a description of the problem |
401 | 401 Unauthorized | An invalid/expired authentication token was supplied |
404 | 404 Not Found | The “orderId” or “reportHashId” supplied did not match an existing order |
500 | 500 Internal Server Error | An error occurred on the server while looking up order reports |