All URIs are relative to https://app.launchdarkly.com/api/v2
Method | HTTP request | Description |
---|---|---|
delete_token | DELETE /tokens/{tokenId} | Delete an access token by ID. |
get_token | GET /tokens/{tokenId} | Get a single access token by ID. |
get_tokens | GET /tokens | Returns a list of tokens in the account. |
patch_token | PATCH /tokens/{tokenId} | Modify an access token by ID. |
post_token | POST /tokens | Create a new token. |
reset_token | POST /tokens/{tokenId}/reset | Reset an access token's secret key with an optional expiry time for the old key. |
delete_token(token_id)
Delete an access token by ID.
# load the gem
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = LaunchDarklyApi::AccessTokensApi.new
token_id = 'token_id_example' # String | The access token ID.
begin
#Delete an access token by ID.
api_instance.delete_token(token_id)
rescue LaunchDarklyApi::ApiError => e
puts "Exception when calling AccessTokensApi->delete_token: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
token_id | String | The access token ID. |
nil (empty response body)
- Content-Type: application/json
- Accept: application/json
Token get_token(token_id)
Get a single access token by ID.
# load the gem
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = LaunchDarklyApi::AccessTokensApi.new
token_id = 'token_id_example' # String | The access token ID.
begin
#Get a single access token by ID.
result = api_instance.get_token(token_id)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Exception when calling AccessTokensApi->get_token: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
token_id | String | The access token ID. |
- Content-Type: application/json
- Accept: application/json
Tokens get_tokens(opts)
Returns a list of tokens in the account.
# load the gem
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = LaunchDarklyApi::AccessTokensApi.new
opts = {
show_all: true # BOOLEAN | If set to true, and the authentication access token has the \"Admin\" role, personal access tokens for all members will be retrieved.
}
begin
#Returns a list of tokens in the account.
result = api_instance.get_tokens(opts)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Exception when calling AccessTokensApi->get_tokens: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
show_all | BOOLEAN | If set to true, and the authentication access token has the "Admin" role, personal access tokens for all members will be retrieved. | [optional] |
- Content-Type: application/json
- Accept: application/json
Token patch_token(token_idpatch_delta)
Modify an access token by ID.
# load the gem
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = LaunchDarklyApi::AccessTokensApi.new
token_id = 'token_id_example' # String | The access token ID.
patch_delta = [LaunchDarklyApi::PatchOperation.new] # Array<PatchOperation> | Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'
begin
#Modify an access token by ID.
result = api_instance.patch_token(token_idpatch_delta)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Exception when calling AccessTokensApi->patch_token: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
token_id | String | The access token ID. | |
patch_delta | Array<PatchOperation> | Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/' |
- Content-Type: application/json
- Accept: application/json
Token post_token(token_body)
Create a new token.
# load the gem
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = LaunchDarklyApi::AccessTokensApi.new
token_body = LaunchDarklyApi::TokenBody.new # TokenBody | Create a new access token.
begin
#Create a new token.
result = api_instance.post_token(token_body)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Exception when calling AccessTokensApi->post_token: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
token_body | TokenBody | Create a new access token. |
- Content-Type: application/json
- Accept: application/json
Token reset_token(token_id, opts)
Reset an access token's secret key with an optional expiry time for the old key.
# load the gem
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = LaunchDarklyApi::AccessTokensApi.new
token_id = 'token_id_example' # String | The access token ID.
opts = {
expiry: 789 # Integer | An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately.
}
begin
#Reset an access token's secret key with an optional expiry time for the old key.
result = api_instance.reset_token(token_id, opts)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Exception when calling AccessTokensApi->reset_token: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
token_id | String | The access token ID. | |
expiry | Integer | An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately. | [optional] |
- Content-Type: application/json
- Accept: application/json