How can we help you today?

Overview #

Introduction and Overview:

This document explains the specifications of auto tag API in PREP

Auto-tagging a PDF document involves two steps.

  • Upload file to auto tag
  • Download file from a URL

The Auto-tag API provides two RESTful endpoints:

  • POST process/auto-tag/ – Upload a PDF file for auto-tagging. This request initiates the auto-tagging process and returns a unique processId.
  • POST process/ping/ – Check the status of the auto-tagging process and retrieve the download URL for the tagged file.This request returns a link to download the auto-tagged PDF.

Authentication #

API ID/KEY setup:

The API key will be sent via email.

API Specs #

Base URL: https://efsaweb.continualengine.com/v1/

Auto-Tag API (Single File) #

Auto tag API

Auto tag Upload API (Python)

POST File to auto tag API

Postman POST auto-tag API success response

Auto tag Upload API (Postman)

Postman POST ping API success response

Auto tag Upload API (Curl)

curl --location 'https://efsaweb.continualengine.com /v1/process /auto-tag/' \

–header ‘api-id: prepuser_sample_id’ \

–header ‘app-key: al31sp4L4dalp37fn8saf’ \

–form ‘pdf1=@”/Users/userce/Downloads/ abcd.pdf”‘

Payload

Key Value type
auto_tag true/false (string)

Response:

Response JSON Status code
{“message”: “ok”, “id”: “157303yTsd2”} 201

Check Auto-Tag Status #

Auto tag file status API:

Auto tag file status API: (Python).

POST processId to get the status and download URL of the Auto-tagged file

import requests

import json

url = “https://efsaweb.continualengine.com /v1/process /ping/”

payload = “{\”processId\”: 157303yTsd2}”

headers = {

‘api-id’: ‘prepuser_sample_id’,

‘app-key’: ‘al31sp4L4dalp37fn8saf’,

‘Content-Type’: ‘application/json’

}

response = requests.request(“POST”, url, headers=headers, data=payload)

print(response.text)

Auto tag File Status API (Postman)

Postman POST ping API success response

Auto tag File Status API (Curl)

curl --location 'https://efsaweb.continualengine.com /v1/process /ping/' \

–header ‘api-id: prepuser_sample_id’ \

–header ‘app-key: al31sp4L4dalp37fn8saf’ \

–header ‘Content-Type: application/json’ \

–data ‘{“processId”: 157303yTsd2}’

Payload

Key Value type
processId String (Alphanumeric) Eg. 157303yTsd2 or integer

Response:

Status of autotag Response JSON Status code
In Progress {“status”: “in-progress”, “value”: “35%”} 200
Completed {“status”: “completed”, “url”: “https://downloadable- client- url .continualengine.com /files/client /lw520db2gtsm4?sign=sj qs35yjsdbv4i4r54j4n a52b30bd”} 200
Failed {“status”: “failed”, “error”: “Internal error.”} 417

Batch Auto-Tag API #

Batch Process (Auto tag API)

Auto tag Upload API (Python)

POST File to auto tag API

import requests

url = “https://efsaweb.continualengine.com/ v1/batch/ auto-tag/”

payload = {}

files=[

(‘zipfile’,(‘abcd.zip,open(‘ /Users/userce /Downloads/ abcd.zip,’rb’), ‘application/zip’))

]

headers = {

‘api-id’: ‘prepuser_sample_id’,

‘app-key’: ‘al31sp4L4dalp37fn8saf’

}

response = requests.request(“POST”, url, headers=headers, data=payload, files=files)

print(response.text)

Batch Process (Auto tag) Upload API (Curl)

curl --location 'https://efsaweb.continualengine.com /v1/batch/ auto-tag/' \

–header ‘api-id: prepuser_sample_id’ \

–header ‘app-key: al31sp4L4dalp37fn8saf’ \

–form ‘zipfile=@”/Users/userce /Downloads/abcd.zip”‘

Response JSON Status code
{“message”: “ok”, “batchId”: “1573”, “files”: [{“file_id”: 2121, “filename”: “a.pdf”}, {“file_id”: 2122, “filename”: “b.pdf”}]} 201

Note: Status of tagging of each file can be fetched using the file id(refer to 3.2 Auto tag file status API) given in the above response.

Batch Status API #

Batch Process (Auto tag) status API

Batch process (Auto tag) status API: (Python)

POST processId to get the status and download URL of the Auto tagged file

import requests

import json

url = “https://efsaweb.continualengine.com /v1/batch /ping/”

payload = “{\”batchId\”:15703}”

headers = {

‘api-id’: ‘prepuser_sample_id’,

‘app-key’: ‘al31sp4L4dalp37fn8saf’,

‘Content-Type’: ‘application/json’

}

response = requests.request(“POST”, url, headers=headers, data=payload)

print(response.text)

Batch process (Auto tag) File Status API (Curl)

curl --location 'https://efsaweb.continualengine.com /v1/batch /ping/' \

–header ‘api-id: prepuser_sample_id’ \

–header ‘app-key: al31sp4L4dalp37fn8saf’ \

–header ‘Content-Type: application/json’ \

–data ‘{“batchId”: 1573}’

Payload

Key Value type
batchId String (Alphanumeric) Eg. 157303yTsd2 or integer

Response:

Status of autotag Response JSON Status code
In Progress {“status”: “in-progress”} 200
Completed {“status”: “completed”, “url”: ” https://downloadable-client- url. continualengine.com /files/client/ fusdf0Pd2d3emf. zip?sign=paecd pil30v8d0b66ccd b”} 200
Failed “status”: “failed”, “error”: “Internal error.”} 417

Error Codes #

Error Codes:

PREP can respond with errors with the below codes.

Error Response JSON Status code
Resource exhausted {“status”: “failed”, “error”: “Either out of resource quota or reaching rate limiting”} 429
Forbidden {“status”: “failed”: “error”: “Forbidden”} 403
Bad Request {“status”: “failed”: “error”: “Invalid argument”} 400
Internal error {“status”: “failed”, “error”: “Internal error.”} 500

Libraries (Dependencies) #

Whether you’re using Python, JavaScript, Java, Ruby, or any other language, you can integrate with our API using the standard HTTP POST method.

Versioning & Updates #

We use Semantic Versioning (SemVer) for our API. Versions are numbered as major.minor.patch. Breaking changes will increment the major version, while new features and improvements will be reflected in the minor version. Bug fixes will trigger a change in the patch version.

Support #

You can reach out to the below contacts in case you have questions.

shubham.doval@continualengine.com / support@continualengine.com

Do You Need Some Help? Don't Worry, We've Got You!

"*" indicates required fields

Step 1 of 3

This field is for validation purposes and should be left unchanged.
What is your goal?*