Get Material Upload Token

最終更新日:2022-01-07 14:31:34

Introduction

Get the material upload token.

Request description

Request methodPost
interface addresshttps://api.cloudv.haplat.net/vod/material/getMaterialUploadToken
Content-TypeOnly supports application/json
Authentication methodAuthentication method V3

Request parameter

parameter nameTypes ofIs it requireddescribe
fileListarrayYesThe 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"}]
domainstringnoMaterial 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
overwritebooleannoUpload strategy, whether to cover. The default is false

The data structure of the fileList array elements is as follows:

parameter nameTypes ofIs it requireddescribe
namestringYesUpload file name, the length cannot exceed 40 characters
suffixstringnoFile extension

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
itemsarraySpecific token information

Data structure of items array elements

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

Example

Input example

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}'





Sample output

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

Error code

The following lists only interface service logic associated error code, the error code common.

error codedescribe
1301User has no permissions
1004Parameter error, please make sure all required fields have been filled in
1000File list is invalid
1000Material suffix exceeds the length range
1000Invalid domain name