Search Task Batches
curl --request POST \
--url https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": {
"eq": "succeed",
"in": [
"succeed"
]
},
"task_name": {
"eq": "miner.system.reboot",
"in": [
"miner.system.reboot"
]
},
"created_at": {
"gt": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z"
},
"page": 1,
"page_size": 20
}
'import requests
url = "https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search"
payload = {
"status": {
"eq": "succeed",
"in": ["succeed"]
},
"task_name": {
"eq": "miner.system.reboot",
"in": ["miner.system.reboot"]
},
"created_at": {
"gt": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z"
},
"page": 1,
"page_size": 20
}
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({
status: {eq: 'succeed', in: ['succeed']},
task_name: {eq: 'miner.system.reboot', in: ['miner.system.reboot']},
created_at: {gt: '2023-11-07T05:31:56Z', lt: '2023-11-07T05:31:56Z'},
page: 1,
page_size: 20
})
};
fetch('https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search', 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.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search",
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([
'status' => [
'eq' => 'succeed',
'in' => [
'succeed'
]
],
'task_name' => [
'eq' => 'miner.system.reboot',
'in' => [
'miner.system.reboot'
]
],
'created_at' => [
'gt' => '2023-11-07T05:31:56Z',
'lt' => '2023-11-07T05:31:56Z'
],
'page' => 1,
'page_size' => 20
]),
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://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search"
payload := strings.NewReader("{\n \"status\": {\n \"eq\": \"succeed\",\n \"in\": [\n \"succeed\"\n ]\n },\n \"task_name\": {\n \"eq\": \"miner.system.reboot\",\n \"in\": [\n \"miner.system.reboot\"\n ]\n },\n \"created_at\": {\n \"gt\": \"2023-11-07T05:31:56Z\",\n \"lt\": \"2023-11-07T05:31:56Z\"\n },\n \"page\": 1,\n \"page_size\": 20\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://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": {\n \"eq\": \"succeed\",\n \"in\": [\n \"succeed\"\n ]\n },\n \"task_name\": {\n \"eq\": \"miner.system.reboot\",\n \"in\": [\n \"miner.system.reboot\"\n ]\n },\n \"created_at\": {\n \"gt\": \"2023-11-07T05:31:56Z\",\n \"lt\": \"2023-11-07T05:31:56Z\"\n },\n \"page\": 1,\n \"page_size\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search")
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 \"status\": {\n \"eq\": \"succeed\",\n \"in\": [\n \"succeed\"\n ]\n },\n \"task_name\": {\n \"eq\": \"miner.system.reboot\",\n \"in\": [\n \"miner.system.reboot\"\n ]\n },\n \"created_at\": {\n \"gt\": \"2023-11-07T05:31:56Z\",\n \"lt\": \"2023-11-07T05:31:56Z\"\n },\n \"page\": 1,\n \"page_size\": 20\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_name": "miner.system.reboot",
"status": "succeed",
"task_count": 4503599627370495,
"succeed_count": 4503599627370495,
"unsuccessful_count": 4503599627370495,
"task_params": {},
"metadata": {},
"created_by": {
"type": "user",
"id": "user_2xGz1234567890",
"name": "John Doe",
"avatar": "https://example.com/avatar.png",
"metadata": {}
},
"created_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"total": 4503599627370495,
"page": 123,
"page_size": 123,
"total_pages": 4503599627370495
},
"error": null
}{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed"
}
}{
"success": false,
"data": null,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing credential"
}
}{
"success": false,
"data": null,
"error": {
"code": "FORBIDDEN",
"message": "Access denied"
}
}{
"success": false,
"data": null,
"error": {
"code": "FARM_NOT_FOUND",
"message": "Farm not found"
}
}{
"success": false,
"data": null,
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}
}Task Batches
Search Task Batches
POST
/
public-api
/
v2
/
workspaces
/
{workspace_id}
/
farms
/
{farm_id}
/
task-batches
/
search
Search Task Batches
curl --request POST \
--url https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": {
"eq": "succeed",
"in": [
"succeed"
]
},
"task_name": {
"eq": "miner.system.reboot",
"in": [
"miner.system.reboot"
]
},
"created_at": {
"gt": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z"
},
"page": 1,
"page_size": 20
}
'import requests
url = "https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search"
payload = {
"status": {
"eq": "succeed",
"in": ["succeed"]
},
"task_name": {
"eq": "miner.system.reboot",
"in": ["miner.system.reboot"]
},
"created_at": {
"gt": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z"
},
"page": 1,
"page_size": 20
}
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({
status: {eq: 'succeed', in: ['succeed']},
task_name: {eq: 'miner.system.reboot', in: ['miner.system.reboot']},
created_at: {gt: '2023-11-07T05:31:56Z', lt: '2023-11-07T05:31:56Z'},
page: 1,
page_size: 20
})
};
fetch('https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search', 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.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search",
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([
'status' => [
'eq' => 'succeed',
'in' => [
'succeed'
]
],
'task_name' => [
'eq' => 'miner.system.reboot',
'in' => [
'miner.system.reboot'
]
],
'created_at' => [
'gt' => '2023-11-07T05:31:56Z',
'lt' => '2023-11-07T05:31:56Z'
],
'page' => 1,
'page_size' => 20
]),
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://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search"
payload := strings.NewReader("{\n \"status\": {\n \"eq\": \"succeed\",\n \"in\": [\n \"succeed\"\n ]\n },\n \"task_name\": {\n \"eq\": \"miner.system.reboot\",\n \"in\": [\n \"miner.system.reboot\"\n ]\n },\n \"created_at\": {\n \"gt\": \"2023-11-07T05:31:56Z\",\n \"lt\": \"2023-11-07T05:31:56Z\"\n },\n \"page\": 1,\n \"page_size\": 20\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://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": {\n \"eq\": \"succeed\",\n \"in\": [\n \"succeed\"\n ]\n },\n \"task_name\": {\n \"eq\": \"miner.system.reboot\",\n \"in\": [\n \"miner.system.reboot\"\n ]\n },\n \"created_at\": {\n \"gt\": \"2023-11-07T05:31:56Z\",\n \"lt\": \"2023-11-07T05:31:56Z\"\n },\n \"page\": 1,\n \"page_size\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search")
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 \"status\": {\n \"eq\": \"succeed\",\n \"in\": [\n \"succeed\"\n ]\n },\n \"task_name\": {\n \"eq\": \"miner.system.reboot\",\n \"in\": [\n \"miner.system.reboot\"\n ]\n },\n \"created_at\": {\n \"gt\": \"2023-11-07T05:31:56Z\",\n \"lt\": \"2023-11-07T05:31:56Z\"\n },\n \"page\": 1,\n \"page_size\": 20\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_name": "miner.system.reboot",
"status": "succeed",
"task_count": 4503599627370495,
"succeed_count": 4503599627370495,
"unsuccessful_count": 4503599627370495,
"task_params": {},
"metadata": {},
"created_by": {
"type": "user",
"id": "user_2xGz1234567890",
"name": "John Doe",
"avatar": "https://example.com/avatar.png",
"metadata": {}
},
"created_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"total": 4503599627370495,
"page": 123,
"page_size": 123,
"total_pages": 4503599627370495
},
"error": null
}{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed"
}
}{
"success": false,
"data": null,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing credential"
}
}{
"success": false,
"data": null,
"error": {
"code": "FORBIDDEN",
"message": "Access denied"
}
}{
"success": false,
"data": null,
"error": {
"code": "FARM_NOT_FOUND",
"message": "Farm not found"
}
}{
"success": false,
"data": null,
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}
}Authorizations
oauth-jwtclerk-api-key
Clerk OAuth JWT access token
Path Parameters
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Body
application/json
Aggregate batch status filter
Show child attributes
Show child attributes
Task name filter
Show child attributes
Show child attributes
Creator type filter
Show child attributes
Show child attributes
Exclusive creation time bounds
Show child attributes
Show child attributes
Required range:
x <= 9007199254740991Required range:
x <= 10000