Get Task Status
curl --request GET \
--url https://apiif.com/v1/tasks/{task_id} \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apiif.com/v1/tasks/{task_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://apiif.com/v1/tasks/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apiif.com/v1/tasks/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://apiif.com/v1/tasks/{task_id}';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiif.com/v1/tasks/{task_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;
}$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$response = Invoke-WebRequest -Uri 'https://apiif.com/v1/tasks/{task_id}' -Method GET -Headers $headersimport requests
url = "https://apiif.com/v1/tasks/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://apiif.com/v1/tasks/{task_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_bodyimport Foundation
let url = URL(string: "https://apiif.com/v1/tasks/{task_id}")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["Authorization": "Bearer <token>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self)){
"code": 200,
"data": {
"id": "task_01KA040M0HP1GJWBJYZMKX1XS1",
"status": "completed",
"progress": 100,
"result": {
"images": [
{
"url": [
"https://upload.apiif.com/f/image/9998236911693428-e8d7441f-f7b4-4130-97ad-9ef8a0dde2ce-image_task_01KA0413RT2GGNZJ9GWQ4PXF2F_0.png"
],
"expires_at": 1763174708
}
]
},
"created": 1763088289,
"completed": 1763088308,
"estimated_time": 60,
"actual_time": 19
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}System
Get Task Status
Query the execution status and result of an asynchronous task. Returns task status, progress and result when completed.
GET
/
v1
/
tasks
/
{task_id}
Get Task Status
curl --request GET \
--url https://apiif.com/v1/tasks/{task_id} \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apiif.com/v1/tasks/{task_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://apiif.com/v1/tasks/{task_id}")
.header("Authorization", "Bearer <token>")
.asString();const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apiif.com/v1/tasks/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://apiif.com/v1/tasks/{task_id}';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiif.com/v1/tasks/{task_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;
}$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$response = Invoke-WebRequest -Uri 'https://apiif.com/v1/tasks/{task_id}' -Method GET -Headers $headersimport requests
url = "https://apiif.com/v1/tasks/{task_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://apiif.com/v1/tasks/{task_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_bodyimport Foundation
let url = URL(string: "https://apiif.com/v1/tasks/{task_id}")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = ["Authorization": "Bearer <token>"]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self)){
"code": 200,
"data": {
"id": "task_01KA040M0HP1GJWBJYZMKX1XS1",
"status": "completed",
"progress": 100,
"result": {
"images": [
{
"url": [
"https://upload.apiif.com/f/image/9998236911693428-e8d7441f-f7b4-4130-97ad-9ef8a0dde2ce-image_task_01KA0413RT2GGNZJ9GWQ4PXF2F_0.png"
],
"expires_at": 1763174708
}
]
},
"created": 1763088289,
"completed": 1763088308,
"estimated_time": 60,
"actual_time": 19
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"type": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Task ID returned by the generation API
Query Parameters
Language for response content (zh/en/ko/ja). Defaults to English.
Available options:
zh, en, ko, ja Response
Task status and result
⌘I