本文档由 云音工坊 自动生成,如有疑问,请联系客服微信:yuntts !
POST https://www.yuntts.com/api/v1/uploadsAuthorization: Bearer <api_key>| 参数 | 类型 | 说明 |
|---|---|---|
file | file | 直接上传文件;批量用 file[] 或 files[] |
files | array | 文件名数组(只传文件名时使用),如 ["a.png","b.mp3"] |
filename | string | 单个文件名(只传文件名时使用) |
ext | string | 仅传扩展名,由服务端生成文件名 |
type | string | 可选,校验类型:image / audio / video |
content_type | string | 可选,上传文件时应使用的 Content-Type |
传文件时使用 multipart/form-data;只传文件名时可用application/json或表单。
items[] 每项包含:| 字段 | 说明 |
|---|---|
filename | 原始文件名 |
type / type_text | 类型(image/audio/video)与中文名 |
url | 文件的最终访问地址 |
size / mime_type | 文件大小与 MIME 类型 |
upload_url | 若返回该字段,需先把文件内容 PUT 到该地址,成功后再使用 url |
object_key | 文件对象名 |
expire | upload_url 有效期(秒) |
content_type | upload_url 要求的 Content-Type |
{"code":<HTTP状态码>,"error":"<错误码>","message":"<说明>"}。{"code":"rest_forbidden"|"rest_invalid_auth"|"rest_missing_api_key"|"rest_invalid_api_key","message":"...","data":{"status":401}}。