Read a document
curl --request GET \
--url https://cite.petal.org/api/document/{document_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://cite.petal.org/api/document/{document_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cite.petal.org/api/document/{document_id}', 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://cite.petal.org/api/document/{document_id}",
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://cite.petal.org/api/document/{document_id}"
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://cite.petal.org/api/document/{document_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cite.petal.org/api/document/{document_id}")
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{
"annotation_ids": [
123
],
"created_at": "<string>",
"csl": {},
"doctype": "<string>",
"file_resource_size": 123,
"file_size": 123,
"id": 123,
"is_trash": true,
"meta": {},
"modified_at": "<string>",
"modified_by": 123,
"organization_id": 123,
"pages": 123,
"resource_size": 123,
"status": {},
"tag_ids": [
123
],
"ui": {},
"use_ocr": true,
"user": {
"id": 123,
"name": "<string>"
},
"annotations": [
{
"comment_count": 123,
"created_at": "<string>",
"description": "<string>",
"document_id": 123,
"id": 123,
"is_hidden": true,
"modified_at": "<string>",
"modified_by": 123,
"type": "<string>",
"use_ocr": true,
"user_id": 123
}
],
"comments": [
{
"annotation_id": 123,
"content": "<string>",
"created_at": "<string>",
"id": 123,
"modified_at": "<string>",
"modified_by": 123,
"user": {
"id": 123,
"name": "<string>"
},
"user_id": 123
}
],
"filename": "<string>",
"keywords": [
"<unknown>"
],
"ranking": 123,
"resource_stats": {
"file_size": 123,
"file_list": "<unknown>",
"file_size_by_mime_type": "<unknown>",
"file_size_by_res_type": "<unknown>"
},
"snippet": "<string>",
"span": [
123
],
"suggested_tags": [
{
"color": "<string>",
"document_count": 123,
"id": 123,
"name": "<string>",
"organization_id": 123
}
],
"tasks": [
{
"id": "<string>",
"args_json": "<string>",
"created_at": "<unknown>",
"function": "<string>",
"group_id": "<string>",
"module": "<string>",
"nrequeue": 123,
"parent_id": 123,
"parent_table": "<string>",
"runtime": 123,
"status": "<string>",
"traceback": "<string>",
"updated_at": "<unknown>"
}
]
}[
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {}
}
]Document
Get a Document
Fetch detailed information on a single Document by its unique ID
GET
/
api
/
document
/
{document_id}
Read a document
curl --request GET \
--url https://cite.petal.org/api/document/{document_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://cite.petal.org/api/document/{document_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cite.petal.org/api/document/{document_id}', 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://cite.petal.org/api/document/{document_id}",
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://cite.petal.org/api/document/{document_id}"
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://cite.petal.org/api/document/{document_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cite.petal.org/api/document/{document_id}")
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{
"annotation_ids": [
123
],
"created_at": "<string>",
"csl": {},
"doctype": "<string>",
"file_resource_size": 123,
"file_size": 123,
"id": 123,
"is_trash": true,
"meta": {},
"modified_at": "<string>",
"modified_by": 123,
"organization_id": 123,
"pages": 123,
"resource_size": 123,
"status": {},
"tag_ids": [
123
],
"ui": {},
"use_ocr": true,
"user": {
"id": 123,
"name": "<string>"
},
"annotations": [
{
"comment_count": 123,
"created_at": "<string>",
"description": "<string>",
"document_id": 123,
"id": 123,
"is_hidden": true,
"modified_at": "<string>",
"modified_by": 123,
"type": "<string>",
"use_ocr": true,
"user_id": 123
}
],
"comments": [
{
"annotation_id": 123,
"content": "<string>",
"created_at": "<string>",
"id": 123,
"modified_at": "<string>",
"modified_by": 123,
"user": {
"id": 123,
"name": "<string>"
},
"user_id": 123
}
],
"filename": "<string>",
"keywords": [
"<unknown>"
],
"ranking": 123,
"resource_stats": {
"file_size": 123,
"file_list": "<unknown>",
"file_size_by_mime_type": "<unknown>",
"file_size_by_res_type": "<unknown>"
},
"snippet": "<string>",
"span": [
123
],
"suggested_tags": [
{
"color": "<string>",
"document_count": 123,
"id": 123,
"name": "<string>",
"organization_id": 123
}
],
"tasks": [
{
"id": "<string>",
"args_json": "<string>",
"created_at": "<unknown>",
"function": "<string>",
"group_id": "<string>",
"module": "<string>",
"nrequeue": 123,
"parent_id": 123,
"parent_table": "<string>",
"runtime": 123,
"status": "<string>",
"traceback": "<string>",
"updated_at": "<unknown>"
}
]
}[
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {}
}
]Authorizations
Response
OK
