Count and page a batch's items
curl --request POST \
--url https://biohub.ai/api/v1/batch/list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"batch_id": "<string>",
"status": [],
"include_responses": false,
"limit": 100,
"cursor": "<string>"
}
'import requests
url = "https://biohub.ai/api/v1/batch/list"
payload = {
"batch_id": "<string>",
"status": [],
"include_responses": False,
"limit": 100,
"cursor": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
batch_id: '<string>',
status: [],
include_responses: false,
limit: 100,
cursor: '<string>'
})
};
fetch('https://biohub.ai/api/v1/batch/list', 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://biohub.ai/api/v1/batch/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'batch_id' => '<string>',
'status' => [
],
'include_responses' => false,
'limit' => 100,
'cursor' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://biohub.ai/api/v1/batch/list"
payload := strings.NewReader("{\n \"batch_id\": \"<string>\",\n \"status\": [],\n \"include_responses\": false,\n \"limit\": 100,\n \"cursor\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://biohub.ai/api/v1/batch/list")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"batch_id\": \"<string>\",\n \"status\": [],\n \"include_responses\": false,\n \"limit\": 100,\n \"cursor\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://biohub.ai/api/v1/batch/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"batch_id\": \"<string>\",\n \"status\": [],\n \"include_responses\": false,\n \"limit\": 100,\n \"cursor\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"batch_id": "<string>",
"endpoint": "<string>",
"status": "in_progress",
"counts": {},
"total": 123,
"expires_at": "2023-11-07T05:31:56Z",
"results_expire_at": "2023-11-07T05:31:56Z",
"items": [
{
"task_id": "<string>",
"status": "queued",
"response": {},
"response_available": true,
"error": {}
}
],
"cursor": "<string>"
},
"request_id": "<string>"
}{
"status": "error",
"message": "<string>",
"request_id": "<string>",
"results_expire_at": "2023-11-07T05:31:56Z"
}{
"status": "error",
"message": "<string>",
"request_id": "<string>",
"results_expire_at": "2023-11-07T05:31:56Z"
}{
"status": "error",
"message": "<string>",
"request_id": "<string>",
"results_expire_at": "2023-11-07T05:31:56Z"
}{
"status": "error",
"message": "<string>",
"request_id": "<string>",
"results_expire_at": "2023-11-07T05:31:56Z"
}{
"status": "error",
"message": "<string>",
"request_id": "<string>",
"results_expire_at": "2023-11-07T05:31:56Z"
}Batch API
batch_list
Read batch status counts and optionally page through its item records.
POST
/
api
/
v1
/
batch
/
list
Count and page a batch's items
curl --request POST \
--url https://biohub.ai/api/v1/batch/list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"batch_id": "<string>",
"status": [],
"include_responses": false,
"limit": 100,
"cursor": "<string>"
}
'import requests
url = "https://biohub.ai/api/v1/batch/list"
payload = {
"batch_id": "<string>",
"status": [],
"include_responses": False,
"limit": 100,
"cursor": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
batch_id: '<string>',
status: [],
include_responses: false,
limit: 100,
cursor: '<string>'
})
};
fetch('https://biohub.ai/api/v1/batch/list', 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://biohub.ai/api/v1/batch/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'batch_id' => '<string>',
'status' => [
],
'include_responses' => false,
'limit' => 100,
'cursor' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://biohub.ai/api/v1/batch/list"
payload := strings.NewReader("{\n \"batch_id\": \"<string>\",\n \"status\": [],\n \"include_responses\": false,\n \"limit\": 100,\n \"cursor\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://biohub.ai/api/v1/batch/list")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"batch_id\": \"<string>\",\n \"status\": [],\n \"include_responses\": false,\n \"limit\": 100,\n \"cursor\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://biohub.ai/api/v1/batch/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"batch_id\": \"<string>\",\n \"status\": [],\n \"include_responses\": false,\n \"limit\": 100,\n \"cursor\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"batch_id": "<string>",
"endpoint": "<string>",
"status": "in_progress",
"counts": {},
"total": 123,
"expires_at": "2023-11-07T05:31:56Z",
"results_expire_at": "2023-11-07T05:31:56Z",
"items": [
{
"task_id": "<string>",
"status": "queued",
"response": {},
"response_available": true,
"error": {}
}
],
"cursor": "<string>"
},
"request_id": "<string>"
}{
"status": "error",
"message": "<string>",
"request_id": "<string>",
"results_expire_at": "2023-11-07T05:31:56Z"
}{
"status": "error",
"message": "<string>",
"request_id": "<string>",
"results_expire_at": "2023-11-07T05:31:56Z"
}{
"status": "error",
"message": "<string>",
"request_id": "<string>",
"results_expire_at": "2023-11-07T05:31:56Z"
}{
"status": "error",
"message": "<string>",
"request_id": "<string>",
"results_expire_at": "2023-11-07T05:31:56Z"
}{
"status": "error",
"message": "<string>",
"request_id": "<string>",
"results_expire_at": "2023-11-07T05:31:56Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The batch to read, from the submit response.
Filter returned items to these statuses. Counts and total remain batch-wide.
Minimum array length:
1Available options:
queued, in_progress, cancelled, done, failed Return the items array as well as the counts. Left off, the call reads counts only, which is what a poll should do.
Items per page. Applies only with include_responses.
Required range:
1 <= x <= 1000The cursor the previous page returned.