获取背景生成结果
curl --request GET \
--url https://api.maxapi.ai/api/tasks/visual/r-background/task_id \
--header 'X-API-KEY: <x-api-key>'import requests
url = "https://api.maxapi.ai/api/tasks/visual/r-background/task_id"
headers = {"X-API-KEY": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<x-api-key>'}};
fetch('https://api.maxapi.ai/api/tasks/visual/r-background/task_id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.maxapi.ai/api/tasks/visual/r-background/task_id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<x-api-key>")
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.maxapi.ai/api/tasks/visual/r-background/task_id")
.header("X-API-KEY", "<x-api-key>")
.asString();{
"status": 200,
"message": "ok",
"data": {
"created_at": "1634884056",
"processed_at": "1634884056",
"completed_at": "1634884056",
"image_1": "https://wxtechsz.oss-cn-shenzhen.aliyuncs.com/tasks/output/segmentation/93a5e47b-a9c1-47ac-9b5e-22cb89f7d358-image.jpg",
"image_2": "https://wxtechsz.oss-cn-shenzhen.aliyuncs.com/tasks/output/segmentation/93a5e47b-a9c1-47ac-9b5e-22cb89f7d358-image.jpg",
"task_id": "94806a3f-1173-4afb-9bcc-3ff19c0981f4",
"progress": 100,
"state": 1,
"return_type": 1,
"state_detail": "Complete",
"time_elapsed": 2536.639892578125
}
}获取背景生成结果。
Url中的参数 task_id 由创建任务后返回。
GET
https://api.maxapi.ai
/
api
/
tasks
/
visual
/
r-background
/
task_id
获取背景生成结果
curl --request GET \
--url https://api.maxapi.ai/api/tasks/visual/r-background/task_id \
--header 'X-API-KEY: <x-api-key>'import requests
url = "https://api.maxapi.ai/api/tasks/visual/r-background/task_id"
headers = {"X-API-KEY": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<x-api-key>'}};
fetch('https://api.maxapi.ai/api/tasks/visual/r-background/task_id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.maxapi.ai/api/tasks/visual/r-background/task_id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<x-api-key>")
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.maxapi.ai/api/tasks/visual/r-background/task_id")
.header("X-API-KEY", "<x-api-key>")
.asString();{
"status": 200,
"message": "ok",
"data": {
"created_at": "1634884056",
"processed_at": "1634884056",
"completed_at": "1634884056",
"image_1": "https://wxtechsz.oss-cn-shenzhen.aliyuncs.com/tasks/output/segmentation/93a5e47b-a9c1-47ac-9b5e-22cb89f7d358-image.jpg",
"image_2": "https://wxtechsz.oss-cn-shenzhen.aliyuncs.com/tasks/output/segmentation/93a5e47b-a9c1-47ac-9b5e-22cb89f7d358-image.jpg",
"task_id": "94806a3f-1173-4afb-9bcc-3ff19c0981f4",
"progress": 100,
"state": 1,
"return_type": 1,
"state_detail": "Complete",
"time_elapsed": 2536.639892578125
}
}请求头
响应
200 - application/json
请求成功