Parse an HTTPS document URL
curl --request POST \
--url https://api.agentbody.io/v1/documents/parse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_name": "<string>",
"file_url": "<string>",
"analysis_chart": true,
"merge_tables": true,
"recognize_seal": true,
"relevel_titles": true,
"return_span_boxes": true
}
'import requests
url = "https://api.agentbody.io/v1/documents/parse"
payload = {
"file_name": "<string>",
"file_url": "<string>",
"analysis_chart": True,
"merge_tables": True,
"recognize_seal": True,
"relevel_titles": True,
"return_span_boxes": True
}
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({
file_name: '<string>',
file_url: '<string>',
analysis_chart: true,
merge_tables: true,
recognize_seal: true,
relevel_titles: true,
return_span_boxes: true
})
};
fetch('https://api.agentbody.io/v1/documents/parse', 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.agentbody.io/v1/documents/parse",
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([
'file_name' => '<string>',
'file_url' => '<string>',
'analysis_chart' => true,
'merge_tables' => true,
'recognize_seal' => true,
'relevel_titles' => true,
'return_span_boxes' => true
]),
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.agentbody.io/v1/documents/parse"
payload := strings.NewReader("{\n \"file_name\": \"<string>\",\n \"file_url\": \"<string>\",\n \"analysis_chart\": true,\n \"merge_tables\": true,\n \"recognize_seal\": true,\n \"relevel_titles\": true,\n \"return_span_boxes\": true\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.agentbody.io/v1/documents/parse")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_name\": \"<string>\",\n \"file_url\": \"<string>\",\n \"analysis_chart\": true,\n \"merge_tables\": true,\n \"recognize_seal\": true,\n \"relevel_titles\": true,\n \"return_span_boxes\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentbody.io/v1/documents/parse")
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 \"file_name\": \"<string>\",\n \"file_url\": \"<string>\",\n \"analysis_chart\": true,\n \"merge_tables\": true,\n \"recognize_seal\": true,\n \"relevel_titles\": true,\n \"return_span_boxes\": true\n}"
response = http.request(request)
puts response.read_body{
"document_id": "00000000-0000-4000-8000-000000000001",
"get_path": "example_value",
"pages": 1,
"preview": "example_value"
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "example error"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "example error"
}
}{
"error": {
"code": "CONFLICT",
"message": "example error"
}
}{
"error": {
"code": "UPSTREAM_INVALID_RESPONSE",
"message": "example error"
}
}{
"error": {
"code": "UPSTREAM_UNAVAILABLE",
"message": "example error"
}
}{
"error": {
"code": "UPSTREAM_TIMEOUT",
"message": "example error"
}
}documents
Parse an HTTPS document URL
Use this operation to parse an https document url. Authenticate with Authorization: Bearer <AGENTBODY_API_KEY>. Correct a 400 invalid-input error; do not retry unchanged. Retry only declared 502, 503, or 504 responses with backoff.
POST
/
v1
/
documents
/
parse
Parse an HTTPS document URL
curl --request POST \
--url https://api.agentbody.io/v1/documents/parse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_name": "<string>",
"file_url": "<string>",
"analysis_chart": true,
"merge_tables": true,
"recognize_seal": true,
"relevel_titles": true,
"return_span_boxes": true
}
'import requests
url = "https://api.agentbody.io/v1/documents/parse"
payload = {
"file_name": "<string>",
"file_url": "<string>",
"analysis_chart": True,
"merge_tables": True,
"recognize_seal": True,
"relevel_titles": True,
"return_span_boxes": True
}
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({
file_name: '<string>',
file_url: '<string>',
analysis_chart: true,
merge_tables: true,
recognize_seal: true,
relevel_titles: true,
return_span_boxes: true
})
};
fetch('https://api.agentbody.io/v1/documents/parse', 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.agentbody.io/v1/documents/parse",
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([
'file_name' => '<string>',
'file_url' => '<string>',
'analysis_chart' => true,
'merge_tables' => true,
'recognize_seal' => true,
'relevel_titles' => true,
'return_span_boxes' => true
]),
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.agentbody.io/v1/documents/parse"
payload := strings.NewReader("{\n \"file_name\": \"<string>\",\n \"file_url\": \"<string>\",\n \"analysis_chart\": true,\n \"merge_tables\": true,\n \"recognize_seal\": true,\n \"relevel_titles\": true,\n \"return_span_boxes\": true\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.agentbody.io/v1/documents/parse")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file_name\": \"<string>\",\n \"file_url\": \"<string>\",\n \"analysis_chart\": true,\n \"merge_tables\": true,\n \"recognize_seal\": true,\n \"relevel_titles\": true,\n \"return_span_boxes\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentbody.io/v1/documents/parse")
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 \"file_name\": \"<string>\",\n \"file_url\": \"<string>\",\n \"analysis_chart\": true,\n \"merge_tables\": true,\n \"recognize_seal\": true,\n \"relevel_titles\": true,\n \"return_span_boxes\": true\n}"
response = http.request(request)
puts response.read_body{
"document_id": "00000000-0000-4000-8000-000000000001",
"get_path": "example_value",
"pages": 1,
"preview": "example_value"
}{
"error": {
"code": "INVALID_ARGUMENT",
"message": "example error"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "example error"
}
}{
"error": {
"code": "CONFLICT",
"message": "example error"
}
}{
"error": {
"code": "UPSTREAM_INVALID_RESPONSE",
"message": "example error"
}
}{
"error": {
"code": "UPSTREAM_UNAVAILABLE",
"message": "example error"
}
}{
"error": {
"code": "UPSTREAM_TIMEOUT",
"message": "example error"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional key for safely retrying a billable write request.
Required string length:
1 - 255Body
application/json
Was this page helpful?
⌘I
