API Server Fundamentals

This section explains how to interface with Agilit-e's API Server

Overview

The URL address for interfacing with the Agilit-e API Server is: https://api.agilite.io.

🚧

NOTE: For on-premise or containerized environments

In nearly every case, the URL for accessing the Agilit-e API Server on-premise would be one of the following addresses:

  • localhost:6010
  • 127.0.0.1:6010
  • custom-ip-address:6010

For containerized environments, the url will be based on the IP address and port assigned to the Agilit-e API Server container.

API Key (Header Parameter)

For every API call made to the Agilit-e API Server, a API Key (aka Agilit-e token) is required in the header of the API request. The header parameter to hold the token is called api-key. Below is an example of this:

curl --request GET \
  --url https://api.agilite.io/keywords/data \
  --header 'api-key: agilite_token'

❗️

Regarding API Keys

Note: You will need to create an API Key in the API Keys Module via the Agilit-e Admin Portal. It is important that this is setup, as the API Key uniquely identifies your Agilit-e Account and tells the Agilit-e API Reference page that you are a part of Agilit-e. Once the API Key is provided for one API, it will exist for the rest
This will be covered next, in the Obtaining an API Key (Agilit-e Token) section.

API Response Schema

For every API request (when the response is not an Array Buffer object - e.g. /files or /generatePDF), the default response is always JSON that has the following properties:

  • success (boolean) - Used to determine if the API transaction was successful or not
  • messages (array) - Holds 1 or more error descriptions if success = false
  • data (mixed object) - Holds the actual data returned from the API request

Below is an example of this:

{
  "success": true,
  "messages": [],
  "data": {}
}

Data Only (Header Parameter)

There is a header parameter that can be used for every API request to Agilit-e called data-only. This parameter affects how the API request returns the JSON response. data-only is an optional parameter and is assumed false by default. If this parameter is set to true, the default API response schema will be modified to only return the actual data, and not the response headers. See below example of both:

{
  "success": true,
  "messages": [],
  "data": {"param":"value"}
}
{"param":"value"}