Upload multiple files in one multipart request
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/files/batch-write"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"manifest\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/files/batch-write \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'manifest=<string>'{
"results": [
{
"status": "success",
"path": "<string>",
"info": {
"name": "<string>",
"path": "<string>",
"is_dir": true,
"size": 123,
"type": "file",
"mode": "0644",
"permissions": "0644",
"owner": "<string>",
"group": "<string>",
"modified_time": "2023-11-07T05:31:56Z",
"symlink_target": "<string>"
}
}
]
}Files
Upload multiple files in one multipart request
Send a multipart request with a manifest part containing JSON like {"files":[{"path":"/tmp/a.txt","field":"file0"}],"user":"alice"} plus one part per file field referenced by the manifest. The response reports per-file successes and failures in request order.
POST
/
v1
/
machines
/
{id}
/
files
/
batch-write
Upload multiple files in one multipart request
import requests
url = "https://api.13-215-85-171.sslip.io/v1/machines/{id}/files/batch-write"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"manifest\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/machines/{id}/files/batch-write \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'manifest=<string>'{
"results": [
{
"status": "success",
"path": "<string>",
"info": {
"name": "<string>",
"path": "<string>",
"is_dir": true,
"size": 123,
"type": "file",
"mode": "0644",
"permissions": "0644",
"owner": "<string>",
"group": "<string>",
"modified_time": "2023-11-07T05:31:56Z",
"symlink_target": "<string>"
}
}
]
}Authorizations
API key passed as Bearer token
Path Parameters
Machine ID (e.g. mch_a1b2c3d4)
Body
multipart/form-data
JSON manifest describing destination paths and multipart field names.
Response
200 - application/json
Batch write result
- Option 1
- Option 2
Show child attributes
Show child attributes