OkayAPI Docs
API Params
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
file | String | Required | Source: POST | 此参数必须使用POST方式传递,且必须进行base64编码后传递,对待上传文件二进制内容进行basse64编码后的数据,此部分数据需要纳入签名。格式示例:file=data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw== | |
file_name | String | Required | 上传的文件名。例如:file_name=test.jpg | ||
file_type | String | Optaion | 上传的文件类型,用于纪录备忘。例如:file_type=image/jpg | ||
upload_full_file_path | String | Optaion | 【仅限使用自己的七牛CDN时生效】用于指定上传图片文件的完整路径,支持目录设置和原始的文件名,例如:upload_full_file_path=images/123.jpg。为空时由系统自动生成随机文件名 |
API Debug
KEY | REQUIRED | VALUE |
---|---|---|
app_key | *Required | |
file | *Required | |
file_name | *Required | |
file_type | Option | |
upload_full_file_path | Option |
API Response
KEY | Type | Description |
---|---|---|
err_code | Int | 操作状态码,0成功,1失败 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
url | String | 成功上传时返回的图片URL,失败时为空 |
https_url | String | 成功上传时返回的HTTPS图片URL,失败或不支持HTTPS时为空 |
id | String | 成功上传时返回的文件ID,失败时为空 |
HTTP Response Code
HTTP Status Code | Description |
---|---|
Http Status = 200 | Success |
Http Status = 400 | Illegal-Params |
Http Status = 401 | Illegal-Token |
Http Status = 402 | IP-Banned |
Http Status = 404 | API-NOT-Exsits |
Http Status = 406 | Illegal-APPKEY |
Http Status = 407 | APPKEY-Expired-Out |
Http Status = 408 | APPKEY-Busy |
Http Status = 409 | Illegal-Sign |
Http Status = 413 | API-Traffic-NOT-Enough |
Http Status = 415 | API-LOCKED |
Http Status = 500 | Internal-Server-Error |