request
curl --request GET \
--url https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>"
}Seedance 查询视频生成任务
查询视频生成任务的状态。
仅支持查询最近 7 天的任务记录,时间区间为 [T-7天, T),其中 T 为请求发起时刻的 UTC 时间戳(精确到秒)。注意:视频 URL 有效期为 14 天,请及时下载或转存。
GET
/
byteplus
/
api
/
v3
/
contents
/
generations
/
tasks
/
{id}
request
curl --request GET \
--url https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.powertokens.ai/byteplus/api/v3/contents/generations/tasks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>"
}授权
在请求头中传入 Authorization: Bearer <token>。
请求头
请求内容类型。
路径参数
您需要查询的视频生成任务的 ID 。
说明:上面参数为Query String Parameters,在URL String中传入。
响应
提交成功,返回视频任务对象。
视频生成任务 ID 。仅保存 7 天(从 created at 时间戳开始计算),超时后将自动清除。
- 设置 "draft": true,为 Draft 视频任务 ID。
- 设置 "draft": false,为正常视频任务 ID。
创建视频生成任务为异步接口,获取 ID 后,需要通过查询视频生成任务 API 来查询视频生成任务的状态。任务成功后,会输出生成视频的 video_url。