Skip to content

Basic API Structure

Explanation

A request is a single API call to the Naurt servers, which generate a response.

Naurt’s APIs all follow a similar structure

{
"queries": List<Object<Query>>,
"options": List<Object<Options>>
}

A query is a single unit request for the relevant API. This allows for multiple uses of the service in a single request. This is greatly encouraged, as it will result in a much faster service.

The options are global to that request. Any options set will affect all queries, if relevant.

Both Query and Options then are generic objects, and will vary between products.

A response is an API event that returns from the Naurt servers. Since a request can contain multiple queries, the response also follows a standard format.

{
"responses": List<Object<Hit>>,
"version": String,
"request_id": Uuid
}

The responses list contains hits, where one hit is a reply to a query. The responses list and the original queries list are in the same order.

The response also contains a version and a request_id. The version is the current version of the server which handled your request. The request_id is a Uuid assigned to your specific response. Please include both in any support tickets you raise.