Retrieve a file
curl --request GET \
--url https://api.usepatchwork.co/v1/files/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usepatchwork.co/v1/files/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.usepatchwork.co/v1/files/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"status": "success",
"data": {
"id": "<string>",
"state": "uploading",
"created_at": "2023-11-07T05:31:56Z",
"media_type": "<string>",
"filename": "<string>",
"size": 123,
"sha256": "<string>",
"segment_size": 123,
"received_segments": [
123
],
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}Files
Retrieve a file
The file object. While uploading, includes received_segments so a dropped client can resume by sending only the missing indices.
GET
/
v1
/
files
/
{id}
Retrieve a file
curl --request GET \
--url https://api.usepatchwork.co/v1/files/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usepatchwork.co/v1/files/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.usepatchwork.co/v1/files/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"status": "success",
"data": {
"id": "<string>",
"state": "uploading",
"created_at": "2023-11-07T05:31:56Z",
"media_type": "<string>",
"filename": "<string>",
"size": 123,
"sha256": "<string>",
"segment_size": 123,
"received_segments": [
123
],
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}Authorizations
Identify accepts a workspace API key (sk_…). Loom accepts either a short-lived session token (direct) or a workspace API key (relay).