curl --request POST \
--url https://api.example.com/v0/records/lookup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"record_id": "<string>",
"version_id": "<string>"
}
]
}
'import requests
url = "https://api.example.com/v0/records/lookup"
payload = { "items": [
{
"record_id": "<string>",
"version_id": "<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({items: [{record_id: '<string>', version_id: '<string>'}]})
};
fetch('https://api.example.com/v0/records/lookup', 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.example.com/v0/records/lookup",
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([
'items' => [
[
'record_id' => '<string>',
'version_id' => '<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://api.example.com/v0/records/lookup"
payload := strings.NewReader("{\n \"items\": [\n {\n \"record_id\": \"<string>\",\n \"version_id\": \"<string>\"\n }\n ]\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.example.com/v0/records/lookup")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"record_id\": \"<string>\",\n \"version_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/records/lookup")
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 \"items\": [\n {\n \"record_id\": \"<string>\",\n \"version_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"index": 1,
"record": {
"record_id": "<string>",
"source": {
"corpus_id": "<string>",
"namespace": "<string>",
"record_key": "<string>"
},
"withdrawn": true,
"current_version_id": "<string>"
},
"version": {
"record_id": "<string>",
"version_id": "<string>",
"manifest": {
"kind": "manifest",
"parts": [
{
"key": "<string>",
"role": "<string>",
"content": {
"kind": "text",
"text": "<string>"
},
"parent_key": "<string>",
"extensions": {}
}
],
"relations": [
{
"type": "<string>",
"target": {
"corpus_id": "<string>",
"namespace": "<string>",
"record_key": "<string>"
},
"source_target_revision": "<string>"
}
]
},
"availability": {
"state": "materialized",
"is_current": true,
"searchable": true
},
"relations": [
{
"source_reference": {
"type": "<string>",
"target": {
"corpus_id": "<string>",
"namespace": "<string>",
"record_key": "<string>"
},
"source_target_revision": "<string>"
},
"status": "available",
"target_record_id": "<string>",
"target_version_id": "<string>"
}
],
"processing": {
"state": "queued",
"phase": "materialization",
"message": "<string>"
},
"accepted_at": "2023-11-07T05:31:56Z",
"extensions": {},
"provenance": {
"source_blob_ids": [
"<string>"
],
"producer": "<string>",
"producer_version": "<string>",
"normalization": {
"plugin_id": "<string>",
"plugin_version": "<string>",
"plugin_api": "<string>",
"contribution": "normalizer",
"idempotency_key": "<string>",
"input_sha256": "<string>",
"invocation_id": "<string>",
"fallback": {
"code": "<string>",
"message": "<string>"
}
}
},
"steps": {
"accepted_at": "2023-11-07T05:31:56Z",
"materialized_at": "2023-11-07T05:31:56Z",
"segmented_at": "2023-11-07T05:31:56Z",
"retrieval_ready_at": "2023-11-07T05:31:56Z",
"enriched_at": "2023-11-07T05:31:56Z",
"evaluated_at": "2023-11-07T05:31:56Z",
"quarantined_at": "2023-11-07T05:31:56Z",
"withdrawn_at": "2023-11-07T05:31:56Z"
},
"diagnostics": [
{
"code": "<string>",
"message": "<string>",
"retryable": true,
"plugin": "<string>",
"plugin_version": "<string>",
"plan": "<string>",
"contribution": "<string>",
"invocation_id": "<string>"
}
]
},
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"field": "<string>",
"resync_url": "<string>"
}
}
]
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"field": "<string>",
"resync_url": "<string>"
}Lookup records
Read up to 100 Records, and optionally one Version of each, in one request. Each entry runs the same authorized reads as getRecord and, when version_id is given, getVersion: the same Organization, Corpus, Record ACL, archive and withdrawal rules apply, and an entry that is absent or inaccessible answers not_found exactly as the single read would. HTTP 200 carries one result per requested entry, in request order, with either the Record (and the Version when one was asked for) or the Error the single reads would have returned. A Record that resolves but whose requested Version does not reports that Version’s Error and no Record. Repeated entries are answered independently. Clients that meet 404 or 405 on this route, such as during a rolling upgrade, can fall back to getRecord and getVersion.
curl --request POST \
--url https://api.example.com/v0/records/lookup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"record_id": "<string>",
"version_id": "<string>"
}
]
}
'import requests
url = "https://api.example.com/v0/records/lookup"
payload = { "items": [
{
"record_id": "<string>",
"version_id": "<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({items: [{record_id: '<string>', version_id: '<string>'}]})
};
fetch('https://api.example.com/v0/records/lookup', 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.example.com/v0/records/lookup",
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([
'items' => [
[
'record_id' => '<string>',
'version_id' => '<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://api.example.com/v0/records/lookup"
payload := strings.NewReader("{\n \"items\": [\n {\n \"record_id\": \"<string>\",\n \"version_id\": \"<string>\"\n }\n ]\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.example.com/v0/records/lookup")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"record_id\": \"<string>\",\n \"version_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/records/lookup")
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 \"items\": [\n {\n \"record_id\": \"<string>\",\n \"version_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"index": 1,
"record": {
"record_id": "<string>",
"source": {
"corpus_id": "<string>",
"namespace": "<string>",
"record_key": "<string>"
},
"withdrawn": true,
"current_version_id": "<string>"
},
"version": {
"record_id": "<string>",
"version_id": "<string>",
"manifest": {
"kind": "manifest",
"parts": [
{
"key": "<string>",
"role": "<string>",
"content": {
"kind": "text",
"text": "<string>"
},
"parent_key": "<string>",
"extensions": {}
}
],
"relations": [
{
"type": "<string>",
"target": {
"corpus_id": "<string>",
"namespace": "<string>",
"record_key": "<string>"
},
"source_target_revision": "<string>"
}
]
},
"availability": {
"state": "materialized",
"is_current": true,
"searchable": true
},
"relations": [
{
"source_reference": {
"type": "<string>",
"target": {
"corpus_id": "<string>",
"namespace": "<string>",
"record_key": "<string>"
},
"source_target_revision": "<string>"
},
"status": "available",
"target_record_id": "<string>",
"target_version_id": "<string>"
}
],
"processing": {
"state": "queued",
"phase": "materialization",
"message": "<string>"
},
"accepted_at": "2023-11-07T05:31:56Z",
"extensions": {},
"provenance": {
"source_blob_ids": [
"<string>"
],
"producer": "<string>",
"producer_version": "<string>",
"normalization": {
"plugin_id": "<string>",
"plugin_version": "<string>",
"plugin_api": "<string>",
"contribution": "normalizer",
"idempotency_key": "<string>",
"input_sha256": "<string>",
"invocation_id": "<string>",
"fallback": {
"code": "<string>",
"message": "<string>"
}
}
},
"steps": {
"accepted_at": "2023-11-07T05:31:56Z",
"materialized_at": "2023-11-07T05:31:56Z",
"segmented_at": "2023-11-07T05:31:56Z",
"retrieval_ready_at": "2023-11-07T05:31:56Z",
"enriched_at": "2023-11-07T05:31:56Z",
"evaluated_at": "2023-11-07T05:31:56Z",
"quarantined_at": "2023-11-07T05:31:56Z",
"withdrawn_at": "2023-11-07T05:31:56Z"
},
"diagnostics": [
{
"code": "<string>",
"message": "<string>",
"retryable": true,
"plugin": "<string>",
"plugin_version": "<string>",
"plan": "<string>",
"contribution": "<string>",
"invocation_id": "<string>"
}
]
},
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"field": "<string>",
"resync_url": "<string>"
}
}
]
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"field": "<string>",
"resync_url": "<string>"
}