SDK
SDK C++ v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

This SDK has been deprecated because of stability issues. It is not advised to use it in a production environment.

send #

Base method used to send queries to Kuzzle, following the API Documentation.

Signature #

kuzzleio::kuzzle_response* send(const std::string& query, kuzzleio::query_options *options, const std::string& request_id);

Arguments #

ArgumentTypeDescription
query
const std::string&
API request
options
kuzzleio::query_options*
Additional query options
request_id
const std::string&
the request_id of the request if you want to set one

request #

Properties required for the Kuzzle API can be set in the kuzzle_request struct. The following properties are the most common.

PropertyTypeDescriptionRequired
controller
const char*
Controller nameyes
action
const char*
Action nameyes
body
const char*
JSON string representing body for this actionno
index
const char*
Index name for this actionno
collection
const char*
Collection name for this actionno
id
const char*
ID for this actionno
volatiles
const char*
JSON string representing additional information to send to Kuzzleno

options #

Additionnal query options.
The following properties are the most common:

PropertyType
(default)
Description
queuable
bool

(true)
If true, queues the request during downtime, until connected to Kuzzle again
refresh
const std::string&

("")
If set to wait_for, waits for the change to be reflected for search (up to 1s)
from
int

(0)
Offset of the first document to fetch
size
int

(10)
Maximum number of documents to retrieve per page
scroll
const std::string&

("")
When set, gets a forward-only cursor having its ttl set to the given value (ie 30s; cf elasticsearch time limits)

request_id #

User-defined request identifier.
Kuzzle does not guarantee that responses are sent back in the same order than queries are made: use that field to link responses to their query of origin.

Return #

A kuzzle_response containing the Kuzzle API response. See the API Documentation. The following properties are the most common.

PropertyTypeDescription
request_id
const char*
Request unique id
result
const char*
Raw JSON result
error
const char*
Error message
status
int
Request status (eg: 200, 403, etc.)