Skip to content

Latest commit

 

History

History
369 lines (248 loc) · 10.1 KB

APIKeysApi.md

File metadata and controls

369 lines (248 loc) · 10.1 KB

OpenAPI\Client\APIKeysApi

All URIs are relative to http://localhost, except if the operation defines another base path.

Method HTTP request Description
createApiKey() POST /v2/api-key Create Api Key
deleteApiKey() DELETE /v2/api-key/{api_key_id} Delete Api Key
getApiKey() GET /v2/api-key/{api_key_id} Get Api Key
getApiKeyScope() GET /v2/api-key/scope Get Api Key Scope
getEnvironmentApiKey() GET /v2/api-key/{proj_id}/{env_id} Get Environment Api Key
listApiKeys() GET /v2/api-key List Api Keys

createApiKey()

createApiKey($api_key_create): \OpenAPI\Client\Model\APIKeyRead

Create Api Key

Creates a new api_key under the active organization.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\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
);
$api_key_create = new \OpenAPI\Client\Model\APIKeyCreate(); // \OpenAPI\Client\Model\APIKeyCreate

try {
    $result = $apiInstance->createApiKey($api_key_create);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling APIKeysApi->createApiKey: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
api_key_create \OpenAPI\Client\Model\APIKeyCreate

Return type

\OpenAPI\Client\Model\APIKeyRead

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteApiKey()

deleteApiKey($api_key_id)

Delete Api Key

Deletes the api_key and all its related data.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\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
);
$api_key_id = 'api_key_id_example'; // string | The unique id of the API key

try {
    $apiInstance->deleteApiKey($api_key_id);
} catch (Exception $e) {
    echo 'Exception when calling APIKeysApi->deleteApiKey: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
api_key_id string The unique id of the API key

Return type

void (empty response body)

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getApiKey()

getApiKey($api_key_id): \OpenAPI\Client\Model\APIKeyRead

Get Api Key

Gets a single api_key matching the given api_key_id, if such api_key exists.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\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
);
$api_key_id = 'api_key_id_example'; // string | The unique id of the API key

try {
    $result = $apiInstance->getApiKey($api_key_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling APIKeysApi->getApiKey: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
api_key_id string The unique id of the API key

Return type

\OpenAPI\Client\Model\APIKeyRead

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getApiKeyScope()

getApiKeyScope(): \OpenAPI\Client\Model\APIKeyScopeRead

Get Api Key Scope

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\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->getApiKeyScope();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling APIKeysApi->getApiKeyScope: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\OpenAPI\Client\Model\APIKeyScopeRead

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getEnvironmentApiKey()

getEnvironmentApiKey($proj_id, $env_id): \OpenAPI\Client\Model\APIKeyRead

Get Environment Api Key

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\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
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").

try {
    $result = $apiInstance->getEnvironmentApiKey($proj_id, $env_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling APIKeysApi->getEnvironmentApiKey: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
proj_id string Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).
env_id string Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).

Return type

\OpenAPI\Client\Model\APIKeyRead

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listApiKeys()

listApiKeys($page, $per_page): \OpenAPI\Client\Model\PaginatedResultAPIKeyRead

List Api Keys

Lists all the api_keys under the active organization.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\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
);
$page = 1; // int | Page number of the results to fetch, starting at 1.
$per_page = 30; // int | The number of results per page (max 100).

try {
    $result = $apiInstance->listApiKeys($page, $per_page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling APIKeysApi->listApiKeys: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
page int Page number of the results to fetch, starting at 1. [optional] [default to 1]
per_page int The number of results per page (max 100). [optional] [default to 30]

Return type

\OpenAPI\Client\Model\PaginatedResultAPIKeyRead

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]