Upload a file with optional parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | file | Yes | The file to upload |
| expiration | string | No | Expiration time: 1hour, 1day, 1week, 1month (default: 1day) |
| delete_after_read | string | No | Delete file after first download: true or false (default: false) |
| Status Code | Description |
|---|---|
| 200 OK | Upload successful |
| 400 Bad Request | Invalid parameters, no file uploaded, or file too large |
| 403 Forbidden | Access denied (IP address or file hash is blacklisted) |
| 413 Payload Too Large | Request body exceeds maximum size (before parsing) |
| 500 Internal Server Error | Server error during upload processing |
| 507 Insufficient Storage | Server storage quota exceeded |
Returns JSON with file information:
{
"id": "IX91qrQrUSjv.txt",
"deletion_token": "iPmOptoDDF7E290xXQmWRRvf5H4GlN22",
"original_filename": "example.txt",
"size": 1024
}
Note: Use the id to construct URLs:
https://box.binoclard.net/{id}https://box.binoclard.net/delete/{id}/{deletion_token}Returns JSON with error details:
{
"detail": "Error message",
"status_code": 400
}
Delete an uploaded file using its ID and deletion token.
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The file ID (from upload response) |
| deletion_token | string | Yes | The deletion token (from upload response) |
| Status Code | Description |
|---|---|
| 204 No Content | File deleted successfully |
| 404 Not Found | File not found or invalid deletion key |
Returns empty response body.
Returns JSON with error details:
{
"detail": "Not Found",
"status_code": 404
}
curl -F "file=@example.txt" https://box.binoclard.net/upload
curl -F "file=@document.pdf" -F "expiration=1week" -F "delete_after_read=true" https://box.binoclard.net/upload
curl -X DELETE https://box.binoclard.net/delete/{id}/{deletion_token}