CDNetworks Documentation Cloud VoD Get Audio Upload Token

Get Audio Upload Token

Last update:2022-01-07 14:31:32

Introduction

Obtain an audio upload token.

Request description

Request methodGet
interface addresshttps://api.cloudv.haplat.net/vod/audioManage/getAudioUploadToken
Do you need a certificateNeed to verify credentials

Request parameter

parameter nameTypes ofIs it requireddescribe
fileListstring      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"}]
domainstringnoAudio 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
overwritebooleannoUpload 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 nameTypes ofIs it requireddescribe
namestring      Yes      Upload file name, the length cannot exceed 200 characters
suffixstringYesFile suffix, such as mp3, currently only supports mp3 format

Return parameter

The general return result is detailed in the data structure of the data parameter returned when the return result is
successful.

parameter nameTypes ofdescribe
uploadUrlstringUpload url address
bucketNamestringThe bucket name of the WCS to be uploaded
httpDnsServestringHttpDns server address
itemsarraySpecific token information.

Data structure of items array elements

parameter nameTypes ofdescribe
namestringfile name
suffixstringFile extension
audioIdstringAudio id
uploadTokenstringUpload token
fileFullUrlstringfile path

Example

Input example

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" 
  <公共的头部参数>
  <自定义的头部参数>


Sample output

{
    "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": "操作成功"
}

Error code

No interface service logic associated error code, the error code common See return result

Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!