All URIs are relative to https://app.launchdarkly.com/api/v2
| Method | HTTP request | Description |
|---|---|---|
| DeleteToken | DELETE /tokens/{tokenId} | Delete an access token by ID. |
| GetToken | GET /tokens/{tokenId} | Get a single access token by ID. |
| GetTokens | GET /tokens | Returns a list of tokens in the account. |
| PatchToken | PATCH /tokens/{tokenId} | Modify an access token by ID. |
| PostToken | POST /tokens | Create a new token. |
| ResetToken | POST /tokens/{tokenId}/reset | Reset an access token's secret key with an optional expiry time for the old key. |
void DeleteToken (string tokenId)
Delete an access token by ID.
using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;
namespace Example
{
public class DeleteTokenExample
{
public void main()
{
// Configure API key authorization: Token
Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");
var apiInstance = new AccessTokensApi();
var tokenId = tokenId_example; // string | The access token ID.
try
{
// Delete an access token by ID.
apiInstance.DeleteToken(tokenId);
}
catch (Exception e)
{
Debug.Print("Exception when calling AccessTokensApi.DeleteToken: " + e.Message );
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| tokenId | string | The access token ID. |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Token GetToken (string tokenId)
Get a single access token by ID.
using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;
namespace Example
{
public class GetTokenExample
{
public void main()
{
// Configure API key authorization: Token
Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");
var apiInstance = new AccessTokensApi();
var tokenId = tokenId_example; // string | The access token ID.
try
{
// Get a single access token by ID.
Token result = apiInstance.GetToken(tokenId);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AccessTokensApi.GetToken: " + e.Message );
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| tokenId | string | The access token ID. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Tokens GetTokens (bool? showAll)
Returns a list of tokens in the account.
using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;
namespace Example
{
public class GetTokensExample
{
public void main()
{
// Configure API key authorization: Token
Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");
var apiInstance = new AccessTokensApi();
var showAll = true; // bool? | If set to true, and the authentication access token has the \"Admin\" role, personal access tokens for all members will be retrieved. (optional)
try
{
// Returns a list of tokens in the account.
Tokens result = apiInstance.GetTokens(showAll);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AccessTokensApi.GetTokens: " + e.Message );
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| showAll | bool? | 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
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Token PatchToken (string tokenId, List patchDelta)
Modify an access token by ID.
using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;
namespace Example
{
public class PatchTokenExample
{
public void main()
{
// Configure API key authorization: Token
Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");
var apiInstance = new AccessTokensApi();
var tokenId = tokenId_example; // string | The access token ID.
var patchDelta = new List<PatchOperation>(); // List<PatchOperation> | Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'
try
{
// Modify an access token by ID.
Token result = apiInstance.PatchToken(tokenId, patchDelta);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AccessTokensApi.PatchToken: " + e.Message );
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| tokenId | string | The access token ID. | |
| patchDelta | List | Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/' |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Token PostToken (TokenBody tokenBody)
Create a new token.
using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;
namespace Example
{
public class PostTokenExample
{
public void main()
{
// Configure API key authorization: Token
Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");
var apiInstance = new AccessTokensApi();
var tokenBody = new TokenBody(); // TokenBody | Create a new access token.
try
{
// Create a new token.
Token result = apiInstance.PostToken(tokenBody);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AccessTokensApi.PostToken: " + e.Message );
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| tokenBody | TokenBody | Create a new access token. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Token ResetToken (string tokenId, long? expiry)
Reset an access token's secret key with an optional expiry time for the old key.
using System;
using System.Diagnostics;
using LaunchDarkly.Api.Api;
using LaunchDarkly.Api.Client;
using LaunchDarkly.Api.Model;
namespace Example
{
public class ResetTokenExample
{
public void main()
{
// Configure API key authorization: Token
Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");
var apiInstance = new AccessTokensApi();
var tokenId = tokenId_example; // string | The access token ID.
var expiry = 789; // long? | An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately. (optional)
try
{
// Reset an access token's secret key with an optional expiry time for the old key.
Token result = apiInstance.ResetToken(tokenId, expiry);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AccessTokensApi.ResetToken: " + e.Message );
}
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| tokenId | string | The access token ID. | |
| expiry | long? | 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
[Back to top] [Back to API list] [Back to Model list] [Back to README]