All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
delete_token | DELETE /api/v2/tokens/{id} | Delete access token |
get_token | GET /api/v2/tokens/{id} | Get access token |
get_tokens | GET /api/v2/tokens | List access tokens |
patch_token | PATCH /api/v2/tokens/{id} | Patch access token |
post_token | POST /api/v2/tokens | Create access token |
reset_token | POST /api/v2/tokens/{id}/reset | Reset access token |
delete_token(id)
Delete access token
Delete an access token by ID.
require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: ApiKey
config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end
api_instance = LaunchDarklyApi::AccessTokensApi.new
id = 'id_example' # String | The ID of the access token to update
begin
# Delete access token
api_instance.delete_token(id)
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling AccessTokensApi->delete_token: #{e}"
end
This returns an Array which contains the response data (nil
in this case), status code and headers.
<Array(nil, Integer, Hash)> delete_token_with_http_info(id)
begin
# Delete access token
data, status_code, headers = api_instance.delete_token_with_http_info(id)
p status_code # => 2xx
p headers # => { ... }
p data # => nil
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling AccessTokensApi->delete_token_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the access token to update |
nil (empty response body)
- Content-Type: Not defined
- Accept: application/json
get_token(id)
Get access token
Get a single access token by ID.
require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: ApiKey
config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end
api_instance = LaunchDarklyApi::AccessTokensApi.new
id = 'id_example' # String | The ID of the access token
begin
# Get access token
result = api_instance.get_token(id)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling AccessTokensApi->get_token: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_token_with_http_info(id)
begin
# Get access token
data, status_code, headers = api_instance.get_token_with_http_info(id)
p status_code # => 2xx
p headers # => { ... }
p data # => <Token>
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling AccessTokensApi->get_token_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the access token |
- Content-Type: Not defined
- Accept: application/json
get_tokens(opts)
List access tokens
Fetch a list of all access tokens.
require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: ApiKey
config.api_key['ApiKey'] = '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['ApiKey'] = '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
# List access tokens
result = api_instance.get_tokens(opts)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling AccessTokensApi->get_tokens: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> get_tokens_with_http_info(opts)
begin
# List access tokens
data, status_code, headers = api_instance.get_tokens_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <Tokens>
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling AccessTokensApi->get_tokens_with_http_info: #{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: Not defined
- Accept: application/json
patch_token(id, patch_operation)
Patch access token
Update an access token's settings. The request should be a valid JSON Patch document describing the changes to be made to the access token.
require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: ApiKey
config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end
api_instance = LaunchDarklyApi::AccessTokensApi.new
id = 'id_example' # String | The ID of the access token to update
patch_operation = [LaunchDarklyApi::PatchOperation.new({op: 'replace', path: '/exampleField', value: new example value})] # Array<PatchOperation> |
begin
# Patch access token
result = api_instance.patch_token(id, patch_operation)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling AccessTokensApi->patch_token: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> patch_token_with_http_info(id, patch_operation)
begin
# Patch access token
data, status_code, headers = api_instance.patch_token_with_http_info(id, patch_operation)
p status_code # => 2xx
p headers # => { ... }
p data # => <Token>
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling AccessTokensApi->patch_token_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the access token to update | |
patch_operation | Array<PatchOperation> |
- Content-Type: application/json
- Accept: application/json
post_token(access_token_post)
Create access token
Create a new access token.
require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: ApiKey
config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end
api_instance = LaunchDarklyApi::AccessTokensApi.new
access_token_post = LaunchDarklyApi::AccessTokenPost.new # AccessTokenPost |
begin
# Create access token
result = api_instance.post_token(access_token_post)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling AccessTokensApi->post_token: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> post_token_with_http_info(access_token_post)
begin
# Create access token
data, status_code, headers = api_instance.post_token_with_http_info(access_token_post)
p status_code # => 2xx
p headers # => { ... }
p data # => <Token>
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling AccessTokensApi->post_token_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
access_token_post | AccessTokenPost |
- Content-Type: application/json
- Accept: application/json
reset_token(id, opts)
Reset access token
Reset an access token's secret key with an optional expiry time for the old key.
require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
# Configure API key authorization: ApiKey
config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end
api_instance = LaunchDarklyApi::AccessTokensApi.new
id = 'id_example' # String | The ID of the access token to update
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 access token
result = api_instance.reset_token(id, opts)
p result
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling AccessTokensApi->reset_token: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> reset_token_with_http_info(id, opts)
begin
# Reset access token
data, status_code, headers = api_instance.reset_token_with_http_info(id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <Token>
rescue LaunchDarklyApi::ApiError => e
puts "Error when calling AccessTokensApi->reset_token_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the access token to update | |
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: Not defined
- Accept: application/json