Search API

The Search API let's you search inside your data.

This page documents the Clinia Search REST API. However, we strongly recomand using our official API clients and librairie to build your search implementation.

Format

The entire API uses JSON encoded as UTF-8.

The body of POST and PUT requests must be either a JSON object or a JSON array (depending on the particular endpoint) and their Content-Type header should be set to application/json; charset=UTF-8.

The body of responses is always a JSON object, and their content type is always application/json; charset=UTF-8.

Authentication

The API uses API Keys to authenticate requests. Authentication is done via HTTP headers:

  • X-Clinia-Engine-Id identifies which engine your are accessing.
  • X-Clinia-API-Key authenticates the request

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

For javascript usage, Cross-origin Resource Sharing (CORS) is supported by the API so that you can use XMLHttpRequest.

Errors

Clinia uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided. Codes in the 5xx range indicate an error with Clinia's servers.

The API uses HTTP status code to indicate if a request succeeded. A 2xx status code indicates success, whereas a 4xx status code indicates failure. When a request fails, the response body will contain a JSON body with additional information of the error.

HTTP Status Code summary

HTTP Status CodeDescription
200 - OKEverything worked as expected
400 - Bad RequestThe request was unacceptable, often due to missing a required parameter.
401 - UnauthorizedNo valid API key provided.
404 - Not Found The requested resource doesn't exist.
500, 502, 503, 504 - Server ErrorsSomething went wrong on Clinia's end.