HTTP/HTTPS
Protocol
果果云 / App API / base64上传文件
base64上传文件
API Url:http://lite.yesx2.com/api/app.php?s=App.File.UploadByBase64
API Description: 通过Base64编码后,上传图片、Word、Excel和PPT,以及PDF、TXT文本、HTML页面、Zip压缩包等文件。
API Parameters
Parameter Name | Type | Is Required | Default | Note | Description |
---|---|---|---|---|---|
access_token | string | Optional | 访问令牌,仅当开启签名验证时需要传递,生成令牌可使用App.Auth.ApplyToken接口 | ||
file | string | Required | - | source: POST | 上传 文件进行basse64编码后的数据。此参数必须使用POST方式传递,且必须进行base64编码后传递。 |
file_name | string | Required | - | 上传的文件名,需要带上文件扩展名。例如:file_name=文档.doc | |
file_type | string | Optional | 上传的文件类型,用于纪录备忘。例如:file_type=doc |
Return Field
Response Result | Type | Description |
---|---|---|
ret | int | status code, 200 is ok, 4xx is bad request, 5xx is server inside error |
data | object/mixed | business data, decided by API implementation |
msg | string | message, usually error message |
Test Online
Parameter | Is Required | Value |
---|---|---|
service | Required | |
access_token | Optional | |
file | Required | |
file_name | Required | |
file_type | Optional |
Client Request Demo
{
"ret": 200,
"data": {
"url": "http://pro.api.phalapi.net/uploads/20200108/224921_28d4936c14ca5b405d35b3ed90dddb4a.jpg"
},
"msg": ""
}
Error List
Error Status | Error Description |
---|---|
400 | ret=400,客户端参数错误或非法请求 |
404 | 表示接口服务不存在 |
406 | ret=406,access_token令牌校验不通过 |
407 | ret=407,app_key权限不足,或未知应用 |
408 | ret=408,当前用户禁止使用,或用户未登录 |
409 | ret=409,接口流量不足 |
410 | ret=410,接口限流 |
500 | 表示服务端内部错误 |
Last generated at: 2024-12-22 04:00:12