渲染任务(Video Remix)
准备渲染任务
POST
/
v1
/
renders
/
prepare
准备渲染任务
curl --request POST \
--url https://apis.viggle.ai/v1/renders/prepare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"character": {
"kind": "upload",
"filename": "<string>",
"content_type": "<string>",
"bytes": 2,
"sha256": "<string>"
},
"motion": {
"kind": "upload",
"filename": "<string>",
"content_type": "<string>",
"bytes": 2,
"sha256": "<string>"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
character: {
kind: 'upload',
filename: '<string>',
content_type: '<string>',
bytes: 2,
sha256: '<string>'
},
motion: {
kind: 'upload',
filename: '<string>',
content_type: '<string>',
bytes: 2,
sha256: '<string>'
}
})
};
fetch('https://apis.viggle.ai/v1/renders/prepare', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apis.viggle.ai/v1/renders/prepare"
payload = {
"character": {
"kind": "upload",
"filename": "<string>",
"content_type": "<string>",
"bytes": 2,
"sha256": "<string>"
},
"motion": {
"kind": "upload",
"filename": "<string>",
"content_type": "<string>",
"bytes": 2,
"sha256": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"draft_id": "<string>",
"state": "awaiting_uploads",
"uploads": [
{
"slot": "character",
"upload_handle": "<string>",
"method": "PUT",
"url": "<string>",
"required_headers": {},
"expires_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": {},
"remediation": {
"action": "none",
"retry_after_ms": 1
}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": {},
"remediation": {
"action": "none",
"retry_after_ms": 1
}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": {},
"remediation": {
"action": "none",
"retry_after_ms": 1
}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": {},
"remediation": {
"action": "none",
"retry_after_ms": 1
}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": {},
"remediation": {
"action": "none",
"retry_after_ms": 1
}
}
}授权
请求体
application/json
⌘I
准备渲染任务
curl --request POST \
--url https://apis.viggle.ai/v1/renders/prepare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"character": {
"kind": "upload",
"filename": "<string>",
"content_type": "<string>",
"bytes": 2,
"sha256": "<string>"
},
"motion": {
"kind": "upload",
"filename": "<string>",
"content_type": "<string>",
"bytes": 2,
"sha256": "<string>"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
character: {
kind: 'upload',
filename: '<string>',
content_type: '<string>',
bytes: 2,
sha256: '<string>'
},
motion: {
kind: 'upload',
filename: '<string>',
content_type: '<string>',
bytes: 2,
sha256: '<string>'
}
})
};
fetch('https://apis.viggle.ai/v1/renders/prepare', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://apis.viggle.ai/v1/renders/prepare"
payload = {
"character": {
"kind": "upload",
"filename": "<string>",
"content_type": "<string>",
"bytes": 2,
"sha256": "<string>"
},
"motion": {
"kind": "upload",
"filename": "<string>",
"content_type": "<string>",
"bytes": 2,
"sha256": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"draft_id": "<string>",
"state": "awaiting_uploads",
"uploads": [
{
"slot": "character",
"upload_handle": "<string>",
"method": "PUT",
"url": "<string>",
"required_headers": {},
"expires_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": {},
"remediation": {
"action": "none",
"retry_after_ms": 1
}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": {},
"remediation": {
"action": "none",
"retry_after_ms": 1
}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": {},
"remediation": {
"action": "none",
"retry_after_ms": 1
}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": {},
"remediation": {
"action": "none",
"retry_after_ms": 1
}
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": {},
"remediation": {
"action": "none",
"retry_after_ms": 1
}
}
}