Query blocks
curl --request POST \
--url https://api.reintersect.com/v0/blocks/query \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.reintersect.com/v0/blocks/query"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.reintersect.com/v0/blocks/query', 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.reintersect.com/v0/blocks/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.reintersect.com/v0/blocks/query"
req, _ := http.NewRequest("POST", 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.post("https://api.reintersect.com/v0/blocks/query")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reintersect.com/v0/blocks/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyBlocks
Query blocks
Page through your install’s blocks of one type whose state matches.
POST
/
v0
/
blocks
/
query
Query blocks
curl --request POST \
--url https://api.reintersect.com/v0/blocks/query \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.reintersect.com/v0/blocks/query"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.reintersect.com/v0/blocks/query', 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.reintersect.com/v0/blocks/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.reintersect.com/v0/blocks/query"
req, _ := http.NewRequest("POST", 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.post("https://api.reintersect.com/v0/blocks/query")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reintersect.com/v0/blocks/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
Finds blocks of one type created by your install whose state has the given top-level values.
Authenticate with an install token. No scope is needed.
With the SDK, call
Body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | The block type. |
stateMatch | object | Yes | Up to 8 top-level state keys with string, number, boolean or null values. {} matches every block of the type. |
cursor | string | No | nextCursor from the previous page. |
limit | number | No | 1 to 100. |
Response
| Field | Type | Description |
|---|---|---|
items | Block[] | Matching blocks, as in Get a block. |
nextCursor | string | null | Pass it as cursor for the next page. |
Errors
_tag | Status | Cause |
|---|---|---|
ReintersectAppBlockTypeUnknownError | 422 | The installed version has no block of this type. |
ReintersectApiInvalidCursorError | 400 | The cursor isn’t from this query. |
reintersect.blocks.query(TaskBlock, { stateMatch: { status: "doing" } }).