获取所有代理任务
curl --request GET \
--url https://api.mintlify.com/v1/agent/{projectId}/jobs \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v1/agent/{projectId}/jobs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mintlify.com/v1/agent/{projectId}/jobs', 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.mintlify.com/v1/agent/{projectId}/jobs",
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.mintlify.com/v1/agent/{projectId}/jobs"
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.mintlify.com/v1/agent/{projectId}/jobs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v1/agent/{projectId}/jobs")
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{
"allSessions": [
{
"sessionId": "<string>",
"subdomain": "<string>",
"branch": "<string>",
"haulted": true,
"pullRequestLink": "<string>",
"messageToUser": "<string>",
"todos": [
{
"content": "<string>",
"id": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z"
}
]
}智能体
获取所有代理任务
获取指定 domain 下的所有 agent 任务,包括其状态和详细信息。
GET
/
agent
/
{projectId}
/
jobs
获取所有代理任务
curl --request GET \
--url https://api.mintlify.com/v1/agent/{projectId}/jobs \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v1/agent/{projectId}/jobs"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mintlify.com/v1/agent/{projectId}/jobs', 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.mintlify.com/v1/agent/{projectId}/jobs",
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.mintlify.com/v1/agent/{projectId}/jobs"
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.mintlify.com/v1/agent/{projectId}/jobs")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v1/agent/{projectId}/jobs")
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{
"allSessions": [
{
"sessionId": "<string>",
"subdomain": "<string>",
"branch": "<string>",
"haulted": true,
"pullRequestLink": "<string>",
"messageToUser": "<string>",
"todos": [
{
"content": "<string>",
"id": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z"
}
]
}用法
响应
授权
Authorization 请求头需要使用 Bearer token。请在此处创建一个 Admin API Key(管理员 API 密钥)。
响应
200 - application/json
已成功检索到所有代理作业
该 domain 的所有代理会话数组。
Show child attributes
Show child attributes
⌘I