Get API Key Permissions | JavaScript API Client V3 (Deprecated)
This version of the JavaScript API client has been deprecated in favor of the latest version of the JavaScript API client.
client.getApiKey(apiKey)
About this method
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
|
string
The date 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. |