Get API Key Permissions
$client->getApiKey(apiKey)
About this method
You are currently reading the JavaScript API client v4 documentation. Check our migration guide to learn how to upgrade from v3 to v4. You can still access the v3 documentation.
You are currently reading the Ruby API client v2 documentation. Check our migration guide to learn how to upgrade from v1 to v2. You can still access the v1 documentation.
Get the permissions of an API key. When initializing the client using the Admin API key, you can request information on any of your application’s API keys. When using a non-admin API key, you can only retrieve information on this specific API key.
Examples
To get the permissions of a given key:
1
2
// Get the rights of a key
$res = $client->getApiKey('YourSearchOnlyAPIKey');
Parameters
apiKey
|
type: string
default: no default
Required
API Key to retrieve permissions for |
Response
In this section we document the JSON response returned by the API. Each language will encapsulate this response inside objects specific to the language and/or the implementation. So the actual type in your language might differ from what is documented.
JSON format
1
2
3
4
5
6
7
{
"value":"d6386f212331969e41493051ede9a25f",
"createdAt":1513610838,
"acl":["search"],
"validity":0,
"description": "my key description"
}
value
|
string
The api key value. |
createdAt
|
number
The timestamp at which the key has been created. |
acl
|
list
List of permissions the key contains. The possible acls are:
|
validity
|
integer
Timestamp of the date at which the key expires. (0 means it will not expire automatically). |
indexes
|
list
The list of targeted indices, if any. |
description
|
string
Description of the key, if set. |