All URIs are relative to https://zernio.com/api, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| createApiKey() | POST /v1/api-keys | Create key |
| deleteApiKey() | DELETE /v1/api-keys/{keyId} | Delete key |
| listApiKeys() | GET /v1/api-keys | List keys |
createApiKey($create_api_key_request): \Zernio\Model\CreateApiKey201ResponseCreate key
Creates a new API key with an optional expiry. The full key value is only returned once in the response.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Zernio\Api\APIKeysApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$create_api_key_request = {"name":"Analytics Read-Only Key","scope":"profiles","profileIds":["6507a1b2c3d4e5f6a7b8c9d0"],"permission":"read"}; // \Zernio\Model\CreateApiKeyRequest
try {
$result = $apiInstance->createApiKey($create_api_key_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling APIKeysApi->createApiKey: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| create_api_key_request | \Zernio\Model\CreateApiKeyRequest |
\Zernio\Model\CreateApiKey201Response
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteApiKey($key_id): \Zernio\Model\DeleteAccountGroup200ResponseDelete key
Permanently revokes and deletes an API key.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Zernio\Api\APIKeysApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$key_id = 'key_id_example'; // string
try {
$result = $apiInstance->deleteApiKey($key_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling APIKeysApi->deleteApiKey: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| key_id | string |
\Zernio\Model\DeleteAccountGroup200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listApiKeys(): \Zernio\Model\ListApiKeys200ResponseList keys
Returns all API keys for the authenticated user. Keys are returned with a preview only, not the full key value.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: bearerAuth
$config = Zernio\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Zernio\Api\APIKeysApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->listApiKeys();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling APIKeysApi->listApiKeys: ', $e->getMessage(), PHP_EOL;
}This endpoint does not need any parameter.
\Zernio\Model\ListApiKeys200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]