$apiInstance = new Fastly\Api\TokensApi(
// 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
);
Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
bulkRevokeTokens() | DELETE /tokens | Revoke multiple tokens |
createToken() | POST /tokens | Create a token |
getToken() | GET /tokens/{token_id} | Get a token |
getTokenCurrent() | GET /tokens/self | Get the current token |
listTokensCustomer() | GET /customer/{customer_id}/tokens | List tokens for a customer |
listTokensUser() | GET /tokens | List tokens for the authenticated user |
revokeToken() | DELETE /tokens/{token_id} | Revoke a token |
revokeTokenCurrent() | DELETE /tokens/self | Revoke the current token |
bulkRevokeTokens($options) // Revoke multiple tokens
Revoke Tokens in bulk format. Users may only revoke their own tokens. Superusers may revoke tokens of others.
$options['request_body'] = {"data":[{"id":"3krg2uUGZzb2W9Euo4moOY","type":"token"},{"id":"71ZA6hv2FO6tGEQIE203Xj","type":"token"}]}; // array<string,object>
try {
$apiInstance->bulkRevokeTokens($options);
} catch (Exception $e) {
echo 'Exception when calling TokensApi->bulkRevokeTokens: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
request_body | array<string,object> | [optional] |
void (empty response body)
[Back to top] [Back to API list] [Back to README]
createToken($options): \Fastly\Model\TokenCreatedResponse // Create a token
Create an API token. If two-factor authentication is enabled for your account, review the instructions for including a one-time password in the request.
try {
$result = $apiInstance->createToken($options);
} catch (Exception $e) {
echo 'Exception when calling TokensApi->createToken: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
This endpoint does not need any parameters.
\Fastly\Model\TokenCreatedResponse
[Back to top] [Back to API list] [Back to README]
getToken($options): \Fastly\Model\TokenResponse // Get a token
Get a single token by its id.
$options['token_id'] = 'token_id_example'; // string | Alphanumeric string identifying a token.
try {
$result = $apiInstance->getToken($options);
} catch (Exception $e) {
echo 'Exception when calling TokensApi->getToken: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
token_id | string | Alphanumeric string identifying a token. |
[Back to top] [Back to API list] [Back to README]
getTokenCurrent($options): \Fastly\Model\TokenResponse // Get the current token
Get a single token based on the access_token used in the request.
try {
$result = $apiInstance->getTokenCurrent($options);
} catch (Exception $e) {
echo 'Exception when calling TokensApi->getTokenCurrent: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
This endpoint does not need any parameters.
[Back to top] [Back to API list] [Back to README]
listTokensCustomer($options): \Fastly\Model\TokenResponse[] // List tokens for a customer
List all tokens belonging to a specific customer.
$options['customer_id'] = 'customer_id_example'; // string | Alphanumeric string identifying the customer.
try {
$result = $apiInstance->listTokensCustomer($options);
} catch (Exception $e) {
echo 'Exception when calling TokensApi->listTokensCustomer: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
customer_id | string | Alphanumeric string identifying the customer. |
[Back to top] [Back to API list] [Back to README]
listTokensUser($options): \Fastly\Model\TokenResponse[] // List tokens for the authenticated user
List all tokens belonging to the authenticated user.
try {
$result = $apiInstance->listTokensUser($options);
} catch (Exception $e) {
echo 'Exception when calling TokensApi->listTokensUser: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
This endpoint does not need any parameters.
[Back to top] [Back to API list] [Back to README]
revokeToken($options) // Revoke a token
Revoke a specific token by its id.
$options['token_id'] = 'token_id_example'; // string | Alphanumeric string identifying a token.
try {
$apiInstance->revokeToken($options);
} catch (Exception $e) {
echo 'Exception when calling TokensApi->revokeToken: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
token_id | string | Alphanumeric string identifying a token. |
void (empty response body)
[Back to top] [Back to API list] [Back to README]
revokeTokenCurrent($options) // Revoke the current token
Revoke a token that is used to authenticate the request.
try {
$apiInstance->revokeTokenCurrent($options);
} catch (Exception $e) {
echo 'Exception when calling TokensApi->revokeTokenCurrent: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
This endpoint does not need any parameters.
void (empty response body)