Overview
The REST module provides support for search API usage against AIE using the existing REST based query arguments but providing output in a simplified JSON response. This JSON model lets developers query AIE using only javascript on the client. Many of the standard domain objects such as IngestDocument, QueryRequest and QueryResponse have been simplified to facilitate the API's ease-of-use in a javascript-only environment rather than requiring a full Java-based object model.
You can access the JSON REST APIs through the AIE baseport (port 17000 by default), using the /rest context root.
All endpoints accept HTTP POST requests, and some methods that do not require POSTed arguments also accept a HTTP GET.
Required Modules
These features require that the rest module be included when you run createproject to create the project directories.
REST API Parameters
The master list of QueryRequest REST parameters is on the HTTP REST APIs page.
REST API Tutorial
Be sure to examine the REST API Tutorial.
View incoming links.
Useful Tools
The following REST clients are recommended.
Platform | Rest Client |
---|---|
Chrome | Postman - Configuration file for search + ingest APIs is attached. The perfmon API is separately attached. |
Firefox | RESTClient |
IE | this space intentionally left blank |
Unix Command Line | cURL with examples found in our tutorial |
Data Types
Data types in requests and responses are mapped to standard javascript types where possible. The following table covers specific data type issues.
Model Data Type | JSON Representation | Examples |
---|---|---|
String | JSON String | "Hello World" |
int, long, double, float | JSON numeric type | 1, 5.678 |
BigDecimal, BigInteger | JSON String | "1234.56789" |
Date | JSON String using date format yyyy-MM-dd'T'HH:mm:ss.SSSZ | "1969-12-31T19:00:10.000-0500" |
Content Types
In order to achieve the correct output format the Accept
and Content-Type
headers need to be set on all requests.
JSONP Support
Any of the URI endpoints that support JSON output will also support JSONP output. JSONP allows web developers to access JSON data structures from remote web app containers without the use of a proxy.
To specify JSONP output, set the 'Accept' request HTTP header to the value 'application/javascript' or 'application/x-javascript'. Most JSONP functions will set the header appropriately automatically. Alternatively, you may force JSON or JSONP output by setting the 'restOutputFormat' parameter to 'json' or 'jsonp' in the query string.
JSONP requests will be padded with a callback function. The function name, which defaults to 'callback', may be specified with the 'jsonpCallback' parameter in the query string.
HTTP Compression
All REST API's support GZIP HTTP compression by default. HTTP compression can drastically reduce the amount of data transmitted over the wire which can reduce the time it takes to issue a request. Compression can be enabled by adding the following header to your HTTP request:
Accept-Encoding: gzip