Files
Files represent files associated with a supplier. They can be used to store additional information about a supplier.
The File object
Properties
idstring
The id of the file.
namestring
The name of the file.
sizenumber
The size of the file.
createdAtdate
The date and time the entity was created.
File object
{
"id": "65af6f23014c1c7a227e890f",
"name": "Ref material.pdf",
"size": 487477,
"createdAt": "2024-01-23T07:47:47.440Z",
}
GET/v2/suppliers/:id/files
List all files
This endpoint allows you to retrieve all the files for a supplier.
Request
GET
/v2/suppliers/:id/filescurl -G https://api.lsp.expert/v2/suppliers/6548c72a13162e1d7ade0290/files \
-u {key}:
Response
[
{
"id": "65af6f23014c1c7a227e890f",
"name": "Ref material.pdf",
"size": 487477,
"createdAt": "2024-01-23T07:47:47.440Z",
},
{...},
{...}
]
POST/v2/suppliers/:id/files/upload
Upload a file
This endpoint allows you to upload a file .
Parameters
fileobject
A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the multipart/form-data protocol.
Request
POST
/v2/suppliers/:id/files/uploadcurl https://api.lsp.expert/v2/suppliers/6548c72a13162e1d7ade0290/files/upload \
-u {key}: \
-F file="@/path/to/a/file.jpg"
Response
{
"id": "6548c72a13162e1d7ade0291",
"name": "file.jpg",
"size": 487477,
"createdAt": "2024-01-23T07:47:47.440Z",
}
GET/v2/suppliers/:id/files/:fileId/download
Download a file
This endpoint allows you to download a file for a supplier.
Request
GET
/v2/suppliers/:id/files/:fileIdcurl https://api.lsp.expert/v2/suppliers/66f1313f9e477f90664d1ad8/files/6548c72a13162e1d7ade0291 \
-u {key}:
DELETE/v2/suppliers/:id/files/:fileId
Delete a file
This endpoint allows you to delete a file.
Request
DELETE
/v2/suppliers/:id/files/:fileIdcurl -X DELETE https://api.lsp.expert/v2/suppliers/66f1313f9e477f90664d1ad8/files/6548c72a13162e1d7ade0291 \
-u {key}: