최신 업데이트:2022-01-07 14:31:32
Obtain an audio upload token.
Request method | Get |
---|---|
interface address | https://api.cloudv.haplat.net/vod/audioManage/getAudioUploadToken |
Do you need a certificate | Need to verify credentials |
parameter name | Types of | Is it required | describe |
---|---|---|---|
fileList | string | Yes | The list of documents that need to get the upload token (parameters include name, suffix), represented by a json string, and encoded with url_safe_base64, can get up to 50 at a time. Example: Use the following string to encode url_safe_base64 [{"name":"fileName1 ","Suffix":"mp3"},{"name":"fileName2","suffix":"mp3"}] |
domain | string | no | Audio domain name, if left blank or empty, it will be set as the default audio domain name. If the domain name does not exist, an error is returned. Without http:// or https://, for example: xxx.com |
overwrite | boolean | no | Upload strategy, whether to cover. The default is true |
The format of fileList before url_safe_base64 encoding is an array, and the data structure of the array elements is as follows:
parameter name | Types of | Is it required | describe |
---|---|---|---|
name | string | Yes | Upload file name, the length cannot exceed 200 characters |
suffix | string | Yes | File suffix, such as mp3, currently only supports mp3 format |
The general return result is detailed in the data structure of the data parameter returned when the return result is
successful.
parameter name | Types of | describe |
---|---|---|
uploadUrl | string | Upload url address |
bucketName | string | The bucket name of the WCS to be uploaded |
httpDnsServe | string | HttpDns server address |
items | array | Specific token information. |
Data structure of items array elements
parameter name | Types of | describe |
---|---|---|
name | string | file name |
suffix | string | File extension |
audioId | string | Audio id |
uploadToken | string | Upload token |
fileFullUrl | string | file path |
curl -X GET
http://api.cloudv.haplat.net/vod/audioManage/getAudioUploadToken?fileList=W3sibmFtZSI6ImZpbGVOYW1lMSIsInN1ZmZpeCI6Im1wMyJ9LHsibmFtZSI6ImZpbGVOYW1lMiIsInN1ZmZpeCI6Im1wMyJ9XQ%3D%3D&domain=xxxx.com&overwrite=true
-H 'content-type: application/x-www-form-urlencoded; charset=utf-8'
-H "Host: api.cloudv.haplat.net"
<公共的头部参数>
<自定义的头部参数>
{
"code": 200,
"data": {
"bucketName": "ovptest",
"httpDnsServer": "https://sdkoptedge.chinanetcenter.com",
"items": [
{
"audioId": "55fcf2d601651000a8262f9200000000",
"fileFullUrl": "audio/201808/55fcf2d601651000bdf74e8200000000_1534745965/55fcf2d601651000bdf74e8200000000.mp3",
"name": "fileName1",
"suffix": "mp3",
"uploadToken": "7e7dae54118c45a6ffd213a18c9d4847b51a73f1:NWFmNWQ1NTQ2NGVkODQ2ZjNkYmUyNWQ5YTdlNjg3ZWEzOTNkOTBlOA==:eyJzY29wZSI6Im92cHRlc3Q6YXVkaW8vMjAxODA4LzU1ZmNmMmQ2MDE2NTEwMDBiZGY3NGU4MjAwMDAwMDAwXzE1MzQ3NDU5NjUvNTVmY2YyZDYwMTY1MTAwMGJkZjc0ZTgyMDAwMDAwMDAubXAzIiwiZGVhZGxpbmUiOiIxNTY2MjgxOTY1MjcxIiwib3ZlcndyaXRlIjoxLCJmc2l6ZUxpbWl0IjowLCJjYWxsYmFja1VybCI6Imh0dHA6Ly8xMTEuMjA2LjIxOS4yMzU6OTcxMS9jYWxsYmFjay9jYWxsYmFjayFhdWRpb1VwbG9hZENhbGxiYWNrLmFjdGlvbiIsImNhbGxiYWNrQm9keSI6IiZidWNrZXQ9JChidWNrZXQpJmtleT0kKGtleSkmZm5hbWU9JChmbmFtZSkmZnNpemU9JChmc2l6ZSkmbWltZVR5cGU9JChtaW1lVHlwZSkmdXJsPSQodXJsKSZpcD0kKGlwKSZjb3N0VGltZT0kKGNvc3RUaW1lKSZhdmluZm89JChhdmluZm8pJmF1ZGlvSWQ9NTVmY2YyZDYwMTY1MTAwMGE4MjYyZjkyMDAwMDAwMDAmY3VzdG9tZXJJZD0xNjA2MTImdXNlck5hbWU9YjNad2RHVnpkQT09JmRvbWFpbklkPTgzMTU3JmZpbGVOYW1lPVptbHNaVTVoYldVeCJ9"
},
{
"audioId": "55fcf2ff0165100008274b0000000000",
"fileFullUrl": "audio/201808/55fcf2ff016510008f88a69200000000_1534745965/55fcf2ff016510008f88a69200000000.mp3",
"name": "fileName2",
"suffix": "mp3",
"uploadToken": "7e7dae54118c45a6ffd213a18c9d4847b51a73f1:NDFkOWQyNzI3YTc2OGE0MGQxYWIwNDZlOTU1ZjMxZWMxYjQ1MmZhNw==:eyJzY29wZSI6Im92cHRlc3Q6YXVkaW8vMjAxODA4LzU1ZmNmMmZmMDE2NTEwMDA4Zjg4YTY5MjAwMDAwMDAwXzE1MzQ3NDU5NjUvNTVmY2YyZmYwMTY1MTAwMDhmODhhNjkyMDAwMDAwMDAubXAzIiwiZGVhZGxpbmUiOiIxNTY2MjgxOTY1MzExIiwib3ZlcndyaXRlIjoxLCJmc2l6ZUxpbWl0IjowLCJjYWxsYmFja1VybCI6Imh0dHA6Ly8xMTEuMjA2LjIxOS4yMzU6OTcxMS9jYWxsYmFjay9jYWxsYmFjayFhdWRpb1VwbG9hZENhbGxiYWNrLmFjdGlvbiIsImNhbGxiYWNrQm9keSI6IiZidWNrZXQ9JChidWNrZXQpJmtleT0kKGtleSkmZm5hbWU9JChmbmFtZSkmZnNpemU9JChmc2l6ZSkmbWltZVR5cGU9JChtaW1lVHlwZSkmdXJsPSQodXJsKSZpcD0kKGlwKSZjb3N0VGltZT0kKGNvc3RUaW1lKSZhdmluZm89JChhdmluZm8pJmF1ZGlvSWQ9NTVmY2YyZmYwMTY1MTAwMDA4Mjc0YjAwMDAwMDAwMDAmY3VzdG9tZXJJZD0xNjA2MTImdXNlck5hbWU9YjNad2RHVnpkQT09JmRvbWFpbklkPTgzMTU3JmZpbGVOYW1lPVptbHNaVTVoYldVeSJ9"
}
],
"uploadUrl": "https://upload.cloudv.haplat.net"
},
"message": "操作成功"
}
No interface service logic associated error code, the error code common See return result