タスク結果の照会
curl --request GET \
--url https://api.highwayapi.ai/v3/async/task-result \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.highwayapi.ai/v3/async/task-result"
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'}
};
fetch('https://api.highwayapi.ai/v3/async/task-result', 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.highwayapi.ai/v3/async/task-result",
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: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.highwayapi.ai/v3/async/task-result"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.highwayapi.ai/v3/async/task-result")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/task-result")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"extra": {
"seed": "<string>",
"debug_info": {
"request_info": "<string>",
"submit_time_ms": "<string>",
"execute_time_ms": "<string>",
"complete_time_ms": "<string>"
}
},
"task": {
"task_id": "<string>",
"status": "<string>",
"reason": "<string>",
"task_type": "<string>",
"eta": 123,
"progress_percent": 123
},
"images": [
{
"image_url": "<string>",
"image_url_ttl": 123,
"image_type": "<string>"
}
],
"videos": [
{
"video_url": "<string>",
"video_url_ttl": "<string>",
"video_type": "<string>"
}
],
"audios": [
{
"audio_url": "<string>",
"audio_url_ttl": "<string>",
"audio_type": "<string>",
"audio_metadata": {
"text": "<string>",
"start_time": 123,
"end_time": 123
}
}
]
}API の基本
タスク結果の照会
GET
/
v3
/
async
/
task-result
タスク結果の照会
curl --request GET \
--url https://api.highwayapi.ai/v3/async/task-result \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.highwayapi.ai/v3/async/task-result"
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'}
};
fetch('https://api.highwayapi.ai/v3/async/task-result', 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.highwayapi.ai/v3/async/task-result",
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: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.highwayapi.ai/v3/async/task-result"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.highwayapi.ai/v3/async/task-result")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/task-result")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"extra": {
"seed": "<string>",
"debug_info": {
"request_info": "<string>",
"submit_time_ms": "<string>",
"execute_time_ms": "<string>",
"complete_time_ms": "<string>"
}
},
"task": {
"task_id": "<string>",
"status": "<string>",
"reason": "<string>",
"task_type": "<string>",
"eta": 123,
"progress_percent": 123
},
"images": [
{
"image_url": "<string>",
"image_url_ttl": 123,
"image_type": "<string>"
}
],
"videos": [
{
"video_url": "<string>",
"video_url_ttl": "<string>",
"video_type": "<string>"
}
],
"audios": [
{
"audio_url": "<string>",
"audio_url_ttl": "<string>",
"audio_type": "<string>",
"audio_metadata": {
"text": "<string>",
"start_time": 123,
"end_time": 123
}
}
]
}「タスク結果照会 API」は、非同期タスクが返す画像、音声、または動画の結果を取得するために使用します。
リクエストヘッダー
string
必須
列挙値:
application/jsonstring
必須
Bearer 認証形式: Bearer {{API Key}}。
クエリパラメーター
string
必須
非同期 API の 200 レスポンスで返される task_id の値。
レスポンス情報パラメーター
object
object
必須
タスクの詳細情報。
非表示 properties
非表示 properties
string
必須
タスク ID。
string
必須
タスクの現在のステータス。列挙値:
TASK_STATUS_QUEUED:タスクはキューに入り、処理待ちです;TASK_STATUS_SUCCEED:タスクは成功しました;TASK_STATUS_FAILED:タスクは失敗しました;TASK_STATUS_PROCESSING:タスクは処理中です;
string
タスク失敗の理由。タスクが失敗した場合にこのフィールドが有効です。
string
必須
タスクのタイプ。
number
タスクの推定完了時間(秒単位)。一部の API でのみこのフィールドが有効です。
number
タスク完了の進捗率。現在、この機能は以下にのみ適用されます:
1. 動画生成 API;
2. テキストから画像 API および 画像から画像 API。
1. 動画生成 API;
2. テキストから画像 API および 画像から画像 API。
object[]
object[]
⌘I