石榴AI开放平台
  1. Upload
石榴AI开放平台
  • Overview
    • Authentication
    • Limits
  • API
    • Speaker
      • Create Speaker
      • Text To Speech
      • List Speakers
      • Query Status
      • Recreate Speaker
      • Delete Speaker
      • Get Recreated Record
    • Avatar
      • Train Avatar Model
      • Train Avatar Model By Image
      • Query Training Status
      • List Avatars
      • Delete Avatar
    • Video
      • Query Status
      • Create Video By Voice
      • Create Video By AudioFile
      • Create Video By Text
    • Asset
      • Get Asset
      • Get Records
    • Upload
      • Get Upload URL
        POST
    • AuthVideo
      • Create ​Authorization Video​
  • Error Code
    • Error Code
  1. Upload

Get Upload URL

开发中
POST
/upload/getPutUrl
生成预签名 URL,用于使用PUT请求上传文件至腾讯云的对象存储,URL带有签名,有效期为24h。
腾讯云对象存储开发可参考文档:https://cloud.tencent.com/document/product/436

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Body 参数application/json
type
string 
文件类型
必需
支持参数:video | audio
suffix
string 
文件后缀
必需
Video类型支持参数格式:mp4\mov\webm; Audio类型支持参数格式:mp3\m4a\wav
示例
{
    "type": "audio",
    "suffix": "m4a"
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.16ai.chat/api/v1/upload/getPutUrl' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "audio",
    "suffix": "m4a"
}'

返回响应

🟢200成功
application/json
Body
code
integer 
状态码
必需
data
object 
响应内容
必需
method
string 
请求方法
必需
默认为PUT请求
type
string 
OSS平台类型
必需
0表示阿里云 1表示腾讯云
object
string 
对象路径
必需
url
string 
资源上传地址
必需
该地址仅用于上传,无法下载资源,有效期为24h
msg
string 
错误信息
必需
示例
{
    "code": 0,
    "data": {
        "method": "string",
        "type": "string",
        "object": "string",
        "url": "string"
    },
    "msg": "string"
}
修改于 2024-09-19 06:44:37
上一页
Get Records
下一页
Create ​Authorization Video​
Built with