Retrieving JSON output

Retrieve a particular content JSON output based on the analyzerId and queries.

Syntax: GET /ca/rest/content/v1/contentAnalyzer/{analyzerId}/json

Table 1. Retrieving JSON requirements
Property Data Type Description
apiKey
header (required)
String To authenticate API call.
analyzerId
path (required)
String Unique identifier for each analyzer. Get from POST/contentAnalyzer response.
attributes query String List of options to get information from JSON Schema, the only accepted formats are (BarcodeList, BlockList, Classification, KVPTable, TableList, AIOutput, DSOutput). If not provided, complete JSON output will be returned.
pages
query
String List of pages to retrieve. If not provided, complete JSON output will be returned.

If attributes and pages are not provided in the query string, the complete JSON results are returned in the response. The final JSON schema contains various document attributes containing all extracted information from a document. For more information, see the section Output - JSON Schema.

GET/contentAnalyzer/{analyzerId}/json

cURL: Example request
curl -X GET -u 'Functional ID:Password' 'https://requesturl/ca/rest/content/v1/contentAnalyzer/{analyzerId}/json' -H 'accept: application/json' -H 'apiKey: ecfc7da2-19af-4734-bdd7-9d0da7bb4852' -H 'authorization: Basic MTIzOjIzNA=='

# if attributes and pages are provided, the URL will be 'https://requesturl/ca/rest/content/v1/contentAnalyzer/{analyzerId}/json?attributes=BarcodeList,KVPTable&pages=1,3'
Python: Example request
import requests
import base64

encoding = base64.b64encode(b'Functional ID:Password')

url = "https://requesturl/ca/rest/content/v1/contentAnalyzer/{analyzerId}/json?pages=1,3"
headers = {
 "apiKey" : "d7239f16-98f0-4024-9688-604750a98abb",
 "authorization": "Basic " + str(encoding)
}

response = requests.request("GET", url, headers=headers)
JavaScript: Example request
var fs = require("fs");
var request = require("request");
var Base64 = require('js-base64').Base64;

var encoding = Base64.encode('Functional ID:Password');
var options = {
  method: 'GET',
  url: 'https://requesturl/ca/rest/content/v1/contentAnalyzer/{analyzerId}/json?pages=1,3',
  headers:
  {
    "apiKey' : 'd7239f16-98f0-4024-9688-604750a98abb',
    'authorization': "Basic " + encoding
  }
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);
});
Java: Example request
import java.io.IOException;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.util.Base64;

String encoding = Base64.getEncoder().encodeToString(("Functional ID:Password").getBytes(‌));

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://requesturl/ca/rest/content/v1/contentAnalyzer/{analyzerId}/json?pages=1,3")
  .get()
  .addHeader("apiKey", "d7239f16-98f0-4024-9688-604750a98abb")
  .addHeader("Authorization", "Basic " + encoding)
  .addHeader("Cache-Control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

/*
 * The JAR files in Referenced Libraries could be found in the Download section with the following link:
 * 1. okhttp.jar - https://github.com/square/okhttp
 * 2. okio.jar - https://github.com/square/okio
 */