Files
Files represent files associated with a job. They can be used to store additional information about a job.
The File object
Properties
idstring
Unique identifier for the object.
namestring
The name of the file.
groupFileIdstring
The group file id if the file is part of a group.
outsourcingobject
Outsourcingsizenumber
The size of the file in bytes.
createdAtdate
The date and time the entity was created.
File object
{
"id": "6703d7085d0425373dd52f20",
"name": "AI5061393.pdf",
"outsourcing": {
"shareWithAll": false,
"sharedWith": []
},
"size": 102360,
"createdAt": "2024-10-07T12:41:44.700Z"
}
List all files
This endpoint allows you to retrieve all the files for a job.
Request
curl -G https://api.lsp.expert/v2/jobs/6548c72a13162e1d7ade0290/files \
-u {key}:
Response
[
{
"id": "6703d7085d0425373dd52f20",
"name": "AI5061393.pdf",
"outsourcing": {
"shareWithAll": false,
"sharedWith": []
},
"size": 102360,
"createdAt": "2024-10-07T12:41:44.700Z"
},
{...},
{...}
]
Upload a file
This endpoint allows you to upload a file. If an outsourcing id is specified, the file will be uploaded to the outsourcing job.
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
curl https://api.lsp.expert/v2/jobs/6548c72a13162e1d7ade0290/files/upload \
-u {key}: \
-F file="@/path/to/a/file.jpg"
Response
{
"id": "6703d7085d0425373dd52f20",
"name": "file.jpg",
"outsourcing": {
"shareWithAll": false,
"sharedWith": []
},
"size": 102360,
"createdAt": "2024-10-07T12:41:44.700Z"
}
Download a file
This endpoint allows you to download a file for a job.
Request
curl https://api.lsp.expert/v2/jobs/66f1313f9e477f90664d1ad8/files/6703d7085d0425373dd52f20 \
-u {key}:
Set shared with all outsourcing jobs
This endpoint allows you to set a file as shared with all outsourcing jobs.
Parameters
Request
curl -X PUT https://api.lsp.expert/v2/jobs/66f1313f9e477f90664d1ad8/files/6703d7085d0425373dd52f20/share/with/all \
-u {key}:
Response
{
"id": "6703d7085d0425373dd52f20",
"name": "file.jpg",
"outsourcing": {
"shareWithAll": true,
"sharedWith": []
},
"size": 102360,
"createdAt": "2024-10-07T12:41:44.700Z"
}
Unset shared with all outsourcing jobs
This endpoint allows you to unset a file as shared with all outsourcing jobs.
Parameters
Request
curl -X DEL https://api.lsp.expert/v2/jobs/66f1313f9e477f90664d1ad8/files/6703d7085d0425373dd52f20/share/with/all \
-u {key}:
Response
{
"id": "6703d7085d0425373dd52f20",
"name": "file.jpg",
"outsourcing": {
"shareWithAll": false,
"sharedWith": []
},
"size": 102360,
"createdAt": "2024-10-07T12:41:44.700Z"
}
Set a file as shared with an outsourcing job
This endpoint allows you to set a file as shared with an outsourcing job.
Parameters
Request
curl -X PUT https://api.lsp.expert/v2/jobs/66f1313f9e477f90664d1ad8/files/6703d7085d0425373dd52f20/share/with/6703d9505d04258be9d537f2 \
-u {key}:
Response
{
"id": "6703d7085d0425373dd52f20",
"name": "file.jpg",
"outsourcing": {
"shareWithAll": true,
"sharedWith": ["6703d9505d04258be9d537f2"]
},
"size": 102360,
"createdAt": "2024-10-07T12:41:44.700Z"
}
Unset a file as shared with an outsourcing job
This endpoint allows you to unset a file as shared with an outsourcing job.
Parameters
Request
curl -X DEL https://api.lsp.expert/v2/jobs/66f1313f9e477f90664d1ad8/files/6703d7085d0425373dd52f20/share/with/6703d9505d04258be9d537f2\
-u {key}:
Response
{
"id": "6703d7085d0425373dd52f20",
"name": "file.jpg",
"outsourcing": {
"shareWithAll": false,
"sharedWith": []
},
"size": 102360,
"createdAt": "2024-10-07T12:41:44.700Z"
}
Delete a file
This endpoint allows you to delete a file.
Request
curl -X DELETE https://api.lsp.expert/v2/jobs/:66f1313f9e477f90664d1ad8/files/6703d7085d0425373dd52f20 \
-u {key}: