Canopy's /file API allows you to pull documents that have been uploaded to any Supplier Profile.
It does not pull any other fields of data from the Supplier Profile. If you require access to the wider set of supplier information, please refer to the /answers API.
It also does not display any flags or status indicators about the supplier. Please refer to the /suppliers API if you require access to the status of the supplier record.
In this article you will learn:
GET data: Structure of the API call
For technical documentation, please following this link
GET data: Structure of the API call
The call using the /file API will require the following components:
URL | https://stage-api.canopy-sm.com/file |
x-api-key |
This is a unique key identifying your specific instance of Canopy Please ask your administrator to obtain this from the Canopy Support Team |
fileId |
This is the unique ID of the file you wish to call over the API The section below explains how to find the relevant file ID |
How to identify the File ID
Each file uploaded to a Supplier Profile in Canopy is given a unique ID. When using the /file API, this ID is used to identify the file you wish to pull.
To work out the file ID of the file you are looking for, you need to run the /answers API.
Please follow the steps below to find the file ID:
- Run the /answers API in your chosen application
Click here for more information about the /answers API - Identify the relevant file from the relevant supplier. The structure of the file in the API will be as follows:
"publicLiabilityInsuranceUpload": [ // NAME OF THE FILE UPLOAD FIELD
{
"Created": "2022-12-21 14:49:01", // DATE THE FILE WAS UPLOADED
"File Name": "blank.pdf", // FILE NAME
"Status": "Valid", // FILE VALIDATION OUTCOME
"Content Type": "application/pdf", // FILE TYPE
"File ID": 11468 // FILE ID
}] - Make a note of the File ID
- When using the /file API, use the File ID from the /answers API to pull the document