searchApiKeys
Searches for API keys.
Query Syntax
HTTP
URL: http://kuzzle:7512/users/api-keys/_search[?from=0][&size=42]
Method: POST
Body:
{
"match": {
"description": "sigfox"
}
}
Other protocols
{
"controller": "auth",
"action": "searchApiKeys",
"body": {
"match": {
"description": "sigfox"
}
},
// optional arguments
"from": 0,
"size": 10
}
Arguments
Optional:
from
: the offset from the first result you want to fetch. Usually used with thesize
argumentsize
: the maximum number of API keys returned in one response page
Body properties
Optional:
The search query itself, using the ElasticSearch Query DSL syntax.
If the body is left empty, the result will return all available api keys for the user.
Response
Returns an object with the following properties:
hits
: array of object. Each object describes a found API key:_id
: API key ID_source
: API key definition without thetoken
field
total
: total number of API keys found. Depending on pagination options, this can be greater than the actual number of API keys in a single result page
{
"status": 200,
"error": null,
"action": "searchApiKeys",
"controller": "auth",
"requestId": "<unique request identifier>",
"result": {
"total": 2,
"hits": [
{
"_id": "api-key-1",
"_source": {
// API key content
}
},
{
"_id": "api-key-1",
"_source" {
// API key content
}
}
]
}
}