上传 您通过POST向我们发送文件,我们将存储它们并以JSON格式返回一个URL。 请求示例curl -F "file=@test.txt" https://api.anonfiles.com/upload成功响应{ "status": true, "data": { "file": { "url": { "full": "https://anonfiles.com/u1C0ebc4b0/file.txt", "short": "https://anonfiles.com/u1C0ebc4b0" }, "metadata": { "id": "u1C0ebc4b0", "name": "file.txt", "size": { "bytes": 6861, "readable": "6.7 KB" } } } }}错误响应{ "status": false, "error": { "message": "The file is too large. Max filesize: 5 GiB", "type": "ERROR_FILE_SIZE_EXCEEDED", "code": 31 }}错误代码和类型- (10) ERROR_FILE_NOT_PROVIDED
- (11) ERROR_FILE_EMPTY
- (12) ERROR_FILE_INVALID
- (20) ERROR_USER_MAX_FILES_PER_HOUR_REACHED
- (21) ERROR_USER_MAX_FILES_PER_DAY_REACHED
- (22) ERROR_USER_MAX_BYTES_PER_HOUR_REACHED
- (23) ERROR_USER_MAX_BYTES_PER_DAY_REACHED
- (30) ERROR_FILE_DISALLOWED_TYPE
- (31) ERROR_FILE_SIZE_EXCEEDED
- (32) ERROR_FILE_BANNED
- (40) STATUS_ERROR_SYSTEM_FAILURE
信息您可以向我们发送 GET 请求以获取有关文件的信息。我们使用 JSON 数组进行响应。
提示:如果要检查文件是否存在,请使用“状态”键(真/假)。
此外,如果请求的文件不存在,则响应将作为 404 发送。 网址格式为: https://api.anonfiles.com/v2/file/{id}/info示例请求https://api.anonfiles.com/v2/file/u1C0ebc4b0/info信息响应{ "status": true, "data": { "file": { "url": { "full": "https://anonfiles.com/u1C0ebc4b0/file.txt", "short": "https://anonfiles.com/u1C0ebc4b0" }, "metadata": { "id": "u1C0ebc4b0", "name": "file.txt", "size": { "bytes": 6861, "readable": "6.7 KB" } } } }}信息错误响应{ "status": false, "error": { "message": "The file you are looking for does not exist.", "type": "FILE_NOT_FOUND", "code": 404 }} |