Skip to main content Link Search Menu Expand Document (external link)

API

The complete documentation for the REST API is available on https://docs.docintel.org/api.

The examples are available on a separate page.

Creating an API Key

Our API provides developers with access to DocIntel functionality, allowing them to integrate it into their own applications. In order to use our API, you will need to create an API key, which will authenticate your requests to our system. In this guide, we will walk you through the process of creating an API key step by step.

Step 1: Log into Your Account To begin, log into your account. Once you are logged in, you will be able to access the “Manage API Key” page.

Step 2: Go to “Manage API Key” In the top-right navigation menu, click on your avatar and select “Manage API Key” from the dropdown menu.

Step 3: Click “Create new API Key” and Fill in the Fields Click the “Create new API Key” button and fill in the fields. The name of your application, and a brief description of how you plan to use the API.

Step 4: Copy the API Key and Use it in Your Scripts Once you have created your API key, you will be able to copy it from the “Manage API Key” page. This key should be kept secure, as it will be used to authenticate your requests to our system. You can then use the API key in your scripts to access our platform’s functionality.

Creating an API key is the first step to using our API. By following these simple steps, you can create an API key and start integrating our platform’s functionality into your own applications. We hope this guide has been helpful, and we look forward to seeing what you build with our API.

Getting Started with Python

To access our API with Python, you will need to install the Requests library. You can do this by running pip install requests in your command prompt or terminal.

First, we will request a token from the API using our API key. This token will be used as a Bearer token in our authorization headers to authenticate our requests. Here’s an example of how to do this:

import requests

# Replace USERNAME with your actual username
USERNAME = "your_username"
# Replace API_KEY with your actual API key
API_KEY = "your_api_key_here"
# Replace API_BASE with the URL of the API endpoint you want to use
API_BASE = "https://[your-instance]/API"

url = f"{API_BASE}/Authentication/Login"

payload = {
    "username": f"{USERNAME}",
    "api_key": f"{API_KEY}"
}
headers = {
    "Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

if response.status_code == 200:
    # Extract the token from the response
    token = response.json()["token"]
    print(token)
else:
    print("Failed to get token from API.")

This request will return a token that you can use in the future API call to get authenticated.

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpVCJ9...EkOl1oTLUieghDJ8NN2ljqeQmUI"
}

Now that we have a token, we can use it to make requests to the API. Let’s retrieve a list of pending documents from the /Document/Pending endpoint:

url = f"{API_BASE}/Document/Pending"

payload = ""
headers = {
    "Authorization": f"Bearer {token}"
}

response = requests.request("GET", url, data=payload, headers=headers)

# Check if the request was successful
if response.status_code == 200:
    # Extract the list of pending documents from the response
    pending_documents = response.json()
    print(pending_documents)
else:
    print("Failed to get list of pending documents from API.")

This code will retrieve the list of pending documents from the API endpoint and print it to the console. You can modify this example to suit your needs and make requests to other endpoints as required. Remember to include your username, API key and the appropriate API URL in your requests. You can view all the endpoints and their documentation on https://docs.docintel.org/api.