文件
GET https://tofile.org/api/files/
curl --request GET \
--url 'https://tofile.org/api/files/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://tofile.org/api/files/' \
--header 'Authorization: Bearer {api_key}' \
参数 | 详情 | 描述 |
---|---|---|
page | 可选 整数 | 您希望获取结果的页码。默认为 1 。 |
results_per_page | 可选 整数 | 每页希望显示多少结果。允许值为:10 , 25 , 50 , 100 , 250 , 500 , 1000 。默认为 25 。 |
{
"data": [
{
"id": 1,
"user_id": 1,
"transfer_id": 1,
"file_uuid": "b8c89fa6e06b4423b3bb1647bb261368",
"uploader_id": "f528764d624db129b32c21fbca0cb8d6",
"name": "9b7d6e9d-fa46-4cc0-8307-8fb6cef88a71.png",
"original_name": "example.png",
"size": 999999,
"status": "uploaded",
"is_encrypted": false,
"datetime": "2025-04-21 12:37:50"
},
],
"meta": {
"page": 1,
"results_per_page": 25,
"total": 1,
"total_pages": 1
},
"links": {
"first": "https://tofile.org/api/files?&page=1",
"last": "https://tofile.org/api/files?&page=1",
"next": null,
"prev": null,
"self": "https://tofile.org/api/files?&page=1"
}
}
GET https://tofile.org/api/files/{file_id}
curl --request GET \
--url 'https://tofile.org/api/files/{file_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://tofile.org/api/files/{file_id}' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"id": 1,
"user_id": 1,
"transfer_id": 1,
"file_uuid": "b8c89fa6e06b4423b3bb1647bb261368",
"uploader_id": "f528764d624db129b32c21fbca0cb8d6",
"name": "9b7d6e9d-fa46-4cc0-8307-8fb6cef88a71.png",
"original_name": "example.png",
"size": 999999,
"status": "uploaded",
"is_encrypted": false,
"datetime": "2025-04-21 12:37:50"
}
}
POST https://tofile.org/files/create_api
参数 | 详情 | 描述 |
---|---|---|
uuid | 必需 字符串 | - |
chunk_index | 必需 整数 | - |
total_chunks | 必需 整数 | - |
file_name | 必需 字符串 | - |
file | 必需 文件 | - |
password | 可选 字符串 | - |
file_encryption_is_enabled | 可选 布尔 | - |
curl --request POST \
--url 'https://tofile.org/files/create_api' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'uuid=de09be56-639f-4213-863b-5ea1aa065970' \
--form 'chunk_index=0' \
--form 'total_chunks=1' \
--form 'file_name=example.pdf' \
--form 'file=example.pdf' \
--url 'https://tofile.org/files/create_api' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'uuid=de09be56-639f-4213-863b-5ea1aa065970' \
--form 'chunk_index=0' \
--form 'total_chunks=1' \
--form 'file_name=example.pdf' \
--form 'file=example.pdf' \
{
"data": {
"id": 1
}
}
DELETE https://tofile.org/api/files/{file_id}
curl --request DELETE \
--url 'https://tofile.org/api/files/{file_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://tofile.org/api/files/{file_id}' \
--header 'Authorization: Bearer {api_key}' \