الحصول على أصل مادة Seedance
curl --request GET \
--url https://api.tokenlab.sh/v1/videos/assets/{assetId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tokenlab.sh/v1/videos/assets/{assetId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tokenlab.sh/v1/videos/assets/{assetId}', 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.tokenlab.sh/v1/videos/assets/{assetId}",
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.tokenlab.sh/v1/videos/assets/{assetId}"
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.tokenlab.sh/v1/videos/assets/{assetId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlab.sh/v1/videos/assets/{assetId}")
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": "asset-20260720123456-qn7wr",
"object": "seedance.material_asset",
"group_id": "group-20260720123456-vrt01",
"library_type": "aigc_avatar",
"asset_name": "Front view",
"asset_type": "Image",
"status": "ACTIVE",
"ready": true,
"error_message": null,
"metadata": null,
"created_at": 1782998400000
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}{
"error": {
"message": "API key not found",
"type": "invalid_request_error"
}
}{
"error": {
"message": "An internal error occurred",
"type": "server_error"
}
}{
"error": {
"message": "Seedance material library request failed",
"type": "server_error",
"code": "seedance_material_library_request_failed"
}
}الفيديو والمواد
الحصول على أصل مادي (Material Asset)
استرجاع أصل مادي واحد من Seedance بواسطة معرف أصل مادي من TokenLab.
GET
/
v1
/
videos
/
assets
/
{assetId}
الحصول على أصل مادة Seedance
curl --request GET \
--url https://api.tokenlab.sh/v1/videos/assets/{assetId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tokenlab.sh/v1/videos/assets/{assetId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tokenlab.sh/v1/videos/assets/{assetId}', 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.tokenlab.sh/v1/videos/assets/{assetId}",
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.tokenlab.sh/v1/videos/assets/{assetId}"
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.tokenlab.sh/v1/videos/assets/{assetId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlab.sh/v1/videos/assets/{assetId}")
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": "asset-20260720123456-qn7wr",
"object": "seedance.material_asset",
"group_id": "group-20260720123456-vrt01",
"library_type": "aigc_avatar",
"asset_name": "Front view",
"asset_type": "Image",
"status": "ACTIVE",
"ready": true,
"error_message": null,
"metadata": null,
"created_at": 1782998400000
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_api_key"
}
}{
"error": {
"message": "API key not found",
"type": "invalid_request_error"
}
}{
"error": {
"message": "An internal error occurred",
"type": "server_error"
}
}{
"error": {
"message": "Seedance material library request failed",
"type": "server_error",
"code": "seedance_material_library_request_failed"
}
}استرجع أصلاً مادياً واحداً وافحص حالة معالجته. لا يمكن استخدام الأصل في إنشاء الفيديو إلا عندما تكون قيمة
ready هي true وحالة status هي ACTIVE.
إذا أرجع إنشاء الفيديو رسالة Seedance material asset not found or not accessible، فتأكد من أنك قمت بتمرير id الخاص بهذا الأصل المادي، وليس group_id الخاص بالمادة.
يعزل project_name الموارد داخل المؤسسة المصادق عليها. قيمته الافتراضية default؛ استخدم القيمة نفسها مع مراعاة حالة الأحرف للمجموعات والأصول المرتبطة. أرسله في جسم JSON مع POST/PUT وفي معاملات الاستعلام مع GET/DELETE.
مثال على الطلب
curl "https://api.tokenlab.sh/v1/videos/assets/asset-20260720123456-qn7wr?project_name=default" \
-H "Authorization: Bearer $TOKENLAB_API_KEY"
مثال على الاستجابة
{
"id": "asset-20260720123456-qn7wr",
"object": "seedance.material_asset",
"project_name": "default",
"group_id": "group-20260720123456-vrt01",
"library_type": "aigc_avatar",
"asset_name": "Front view",
"asset_type": "Image",
"status": "ACTIVE",
"ready": true,
"error_message": null,
"metadata": null,
"created_at": 1782998400000
}
التفويضات
مصادقة مفتاح API. قم بإنشاء أو إدارة مفاتيح API في Dashboard > API > API Keys.
معلمات المسار
معلمات الاستعلام
نطاق المشروع لمورد المادة.
Required string length:
1 - 128الاستجابة
أصل المادة
معرف أصل مادة TokenLab. استخدم هذا كـ material_asset_id بعد أن يصبح الأصل ACTIVE.
الخيارات المتاحة:
seedance.material_asset الخيارات المتاحة:
aigc_avatar, liveness_face الخيارات المتاحة:
Image, Video, Audio الخيارات المتاحة:
PROCESSING, ACTIVE, FAILED, DELETED تكون true عندما يكون الأصل نشطاً وغير محذوف.
معرف مجموعة مواد TokenLab التي تمتلك أصل المادة هذا.
نطاق المشروع لأصل المادة هذا.
خطأ معالجة نهائي آمن للنشر. تشمل إخفاقات التحقق من المصدر الدائمة قيود الأبعاد المرفوضة.
طابع زمني بنظام Unix يوضح وقت إنشاء سجل أصل المادة.
طابع زمني بنظام Unix يوضح وقت آخر تحديث لسجل أصل المادة.