Aufgabenergebnis abfragen
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-Grundlagen
Aufgabenergebnis abfragen
GET
/
v3
/
async
/
task-result
Aufgabenergebnis abfragen
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
}
}
]
}Die „API zum Abfragen von Aufgabenergebnissen“ wird verwendet, um die von asynchronen Aufgaben zurückgegebenen Bild-, Audio- oder Videoergebnisse abzurufen.
Anfrageheader
string
erforderlich
Enumerationswert:
application/jsonstring
erforderlich
Bearer-Authentifizierungsformat: Bearer {{API Key}}.
Abfrageparameter
string
erforderlich
Der in der 200-Antwort der asynchronen API zurückgegebene Wert task_id.
Antwortparameter
object
Anzeigen properties
Anzeigen properties
string
object
Debug-Informationen
Anzeigen properties
Anzeigen properties
object
erforderlich
Aufgabendetails.
Ausblenden properties
Ausblenden properties
string
erforderlich
Aufgaben-ID.
string
erforderlich
Aktueller Status der Aufgabe. Enumerationswerte:
TASK_STATUS_QUEUED: Aufgabe befindet sich in der Warteschlange und wartet auf Verarbeitung;TASK_STATUS_SUCCEED: Aufgabe wurde erfolgreich abgeschlossen;TASK_STATUS_FAILED: Aufgabe ist fehlgeschlagen;TASK_STATUS_PROCESSING: Aufgabe wird gerade verarbeitet;
string
Grund für das Fehlschlagen der Aufgabe; dieses Feld ist gültig, wenn die Aufgabe fehlschlägt.
string
erforderlich
Typ der Aufgabe.
number
Geschätzte Zeit bis zum Abschluss der Aufgabe, in Sekunden. Dieses Feld ist nur bei einigen APIs gültig.
number
Fortschritt der Aufgabenerledigung in Prozent. Diese Funktion ist derzeit nur verfügbar für:
1. Videoerzeugungs-API;
2. Text-zu-Bild-API und Bild-zu-Bild-API.
1. Videoerzeugungs-API;
2. Text-zu-Bild-API und Bild-zu-Bild-API.
object[]
object[]
object[]
Gibt die ausgegebenen Audiodateien für audiobezogene Aufgaben zurück.
Anzeigen properties
Anzeigen properties
string
Audio-URL.
string
Ablaufzeit der Audio-URL (in Sekunden). Der Standardwert beträgt 3600 Sekunden.
string
Audiotyp. Enumerationswert:
wav⌘I