最終更新日:2022-01-07 14:31:34
Get the material upload token.
Request method | Post |
---|---|
interface address | https://api.cloudv.haplat.net/vod/material/getMaterialUploadToken |
Content-Type | Only supports application/json |
Authentication method | Authentication method V3 |
parameter name | Types of | Is it required | describe |
---|---|---|---|
fileList | array | Yes | The list of documents that need to get the upload token (parameters include name, suffix), up to 50 at a time. Example: [{"name":"fileName1","suffix":"jpg"},{"name":"fileName2 ","Suffix":"jpg"}] |
domain | string | no | Material domain name, if left blank or blank, it will be set as the default material 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 false |
The data structure of the fileList array elements is as follows:
parameter name | Types of | Is it required | describe |
---|---|---|---|
name | string | Yes | Upload file name, the length cannot exceed 40 characters |
suffix | string | no | File extension |
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 |
items | array | Specific token information |
Data structure of items array elements
parameter name | Types of | describe |
---|---|---|
name | string | file name |
suffix | string | File extension |
materialId | string | Material id |
uploadToken | string | Upload token |
fileFullUrl | string | file path |
curl -X POST
http://api.cloudv.haplat.net/vod/materialManage/getMaterialUploadToken
-H 'content-type: application/json'
-H "Host: api.cloudv.haplat.net"
<公共的头部参数>
<自定义的头部参数>
-d '{"fileList":[{"name":"test01","suffix":"jpg"},{"name":"test02","suffix":"jpeg"}],domain=xxxx.com,overwrite=false}'
{
"code": 200,
"data": {
"bucketName": "ovptest",
"items": [
{
"fileFullUrl": "ovptest:cloudv-material/20200629/feb8ec8801721000b3c0f2f500000000.jpg",
"materialId": "feb8ec880172100060d1cff500000000",
"name": "test01.",
"suffix": "jpg",
"uploadToken": "7e7dae54118c45a6ffd213a18c9d4847b51a73f1:NzNiZjc2NzRkYjUzMTk0NDY4NDhiNGY2N2YxMjVlOWNjZjBjMjBiYg==:eyJzY29wZSI6Im92cHRlc3Q6Y2xvdWR2LW1hdGVyaWFsLzIwMjAwNjI5L2ZlYjhlYzg4MDE3MjEwMDBiM2MwZjJmNTAwMDAwMDAwLmpwZyIsImRlYWRsaW5lIjoiOTIyMzM3MjAzNjg1NDc3NTgwNyIsIm92ZXJ3cml0ZSI6MCwiZnNpemVMaW1pdCI6MCwiY2FsbGJhY2tVcmwiOiJodHRwOi8vY2FsbGJhY2tkZXYub3ZwdGVzdC5oYXBsYXQubmV0L2NhbGxiYWNrL2NhbGxiYWNrIW1hdGVyaWFsVXBsb2FkQ2FsbGJhY2suYWN0aW9uIiwiY2FsbGJhY2tCb2R5IjoiJmtleT0kKGtleSkmZm5hbWU9dGVzdDAxLmpwZyZmc2l6ZT0kKGZzaXplKSZtaW1lVHlwZT0kKG1pbWVUeXBlKSZ1cmw9JCh1cmwpJm1hdGVyaWFsSWQ9ZmViOGVjODgwMTcyMTAwMDYwZDFjZmY1MDAwMDAwMDAmdXNlck5hbWU9b3ZwdGVzdCZkb21haW5JZD04MzA1In0="
},
{
"fileFullUrl": "ovptest:cloudv-material/20200629/feb8eca801721000462961b400000000.jpeg",
"materialId": "feb8eca8017210001ddc3b3900000000",
"name": "test02.",
"suffix": "jpeg",
"uploadToken": "7e7dae54118c45a6ffd213a18c9d4847b51a73f1:MWU4NWM3YWIxOWUwN2MyYmIwYTNkMjdlYjQzMjQxMDg4NjAzZjE1Yg==:eyJzY29wZSI6Im92cHRlc3Q6Y2xvdWR2LW1hdGVyaWFsLzIwMjAwNjI5L2ZlYjhlY2E4MDE3MjEwMDA0NjI5NjFiNDAwMDAwMDAwLmpwZWciLCJkZWFkbGluZSI6IjkyMjMzNzIwMzY4NTQ3NzU4MDciLCJvdmVyd3JpdGUiOjAsImZzaXplTGltaXQiOjAsImNhbGxiYWNrVXJsIjoiaHR0cDovL2NhbGxiYWNrZGV2Lm92cHRlc3QuaGFwbGF0Lm5ldC9jYWxsYmFjay9jYWxsYmFjayFtYXRlcmlhbFVwbG9hZENhbGxiYWNrLmFjdGlvbiIsImNhbGxiYWNrQm9keSI6IiZrZXk9JChrZXkpJmZuYW1lPXRlc3QwMi5qcGVnJmZzaXplPSQoZnNpemUpJm1pbWVUeXBlPSQobWltZVR5cGUpJnVybD0kKHVybCkmbWF0ZXJpYWxJZD1mZWI4ZWNhODAxNzIxMDAwMWRkYzNiMzkwMDAwMDAwMCZ1c2VyTmFtZT1vdnB0ZXN0JmRvbWFpbklkPTgzMDUifQ=="
}
],
"uploadUrl": "https://upload.cloudv.haplat.net"
},
"message": "操作成功"
}
The following lists only interface service logic associated error code, the error code common.
error code | describe |
---|---|
1301 | User has no permissions |
1004 | Parameter error, please make sure all required fields have been filled in |
1000 | File list is invalid |
1000 | Material suffix exceeds the length range |
1000 | Invalid domain name |