Skip to content

Latest commit

 

History

History
284 lines (172 loc) · 6.55 KB

TokensApi.md

File metadata and controls

284 lines (172 loc) · 6.55 KB

TokensApi

All URIs are relative to https://api.fastly.com

Method HTTP request Description
bulk_revoke_tokens DELETE /tokens Revoke multiple tokens
create_token POST /tokens Create a token
get_token GET /tokens/{token_id} Get a token
get_token_current GET /tokens/self Get the current token
list_tokens_customer GET /customer/{customer_id}/tokens List tokens for a customer
list_tokens_user GET /tokens List tokens for the authenticated user
revoke_token DELETE /tokens/{token_id} Revoke a token
revoke_token_current DELETE /tokens/self Revoke the current token

bulk_revoke_tokens

Revoke Tokens in bulk format. Users may only revoke their own tokens. Superusers may revoke tokens of others.

let cfg = &Configuration::default();
let params = BulkRevokeTokensParams {
    // parameters
};
bulk_revoke_tokens(cfg, params)

Parameters

Name Type Description Required Notes
request_body Option<::std::collections::HashMap<String, serde_json::Value>>

Return type

(empty response body)

Authorization

token

HTTP request headers

  • Content-Type: application/vnd.api+json; ext=bulk
  • Accept: Not defined

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

create_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.

let cfg = &Configuration::default();
let params = CreateTokenParams {
    // parameters
};
create_token(cfg, params)

Parameters

This endpoint does not need any parameter.

Return type

crate::models::TokenCreatedResponse

Authorization

token, username_and_password

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

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

get_token

Get a single token by its id.

let cfg = &Configuration::default();
let params = GetTokenParams {
    // parameters
};
get_token(cfg, params)

Parameters

Name Type Description Required Notes
token_id String Alphanumeric string identifying a token. [required]

Return type

crate::models::TokenResponse

Authorization

token

HTTP request headers

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

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

get_token_current

Get a single token based on the access_token used in the request.

let cfg = &Configuration::default();
let params = GetTokenCurrentParams {
    // parameters
};
get_token_current(cfg, params)

Parameters

This endpoint does not need any parameter.

Return type

crate::models::TokenResponse

Authorization

token

HTTP request headers

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

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

list_tokens_customer

List all tokens belonging to a specific customer.

let cfg = &Configuration::default();
let params = ListTokensCustomerParams {
    // parameters
};
list_tokens_customer(cfg, params)

Parameters

Name Type Description Required Notes
customer_id String Alphanumeric string identifying the customer. [required]

Return type

Vec<crate::models::TokenResponse>

Authorization

token

HTTP request headers

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

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

list_tokens_user

List all tokens belonging to the authenticated user.

let cfg = &Configuration::default();
let params = ListTokensUserParams {
    // parameters
};
list_tokens_user(cfg, params)

Parameters

This endpoint does not need any parameter.

Return type

Vec<crate::models::TokenResponse>

Authorization

token

HTTP request headers

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

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

revoke_token

Revoke a specific token by its id.

let cfg = &Configuration::default();
let params = RevokeTokenParams {
    // parameters
};
revoke_token(cfg, params)

Parameters

Name Type Description Required Notes
token_id String Alphanumeric string identifying a token. [required]

Return type

(empty response body)

Authorization

token

HTTP request headers

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

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

revoke_token_current

Revoke a token that is used to authenticate the request.

let cfg = &Configuration::default();
let params = RevokeTokenCurrentParams {
    // parameters
};
revoke_token_current(cfg, params)

Parameters

This endpoint does not need any parameter.

Return type

(empty response body)

Authorization

token

HTTP request headers

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

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