Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Latest commit

 

History

History
407 lines (307 loc) · 12 KB

File metadata and controls

407 lines (307 loc) · 12 KB

LaunchDarkly.Api.Api.AccessTokensApi

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.

DeleteToken

void DeleteToken (string tokenId)

Delete an access token by ID.

Example

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 );
            }
        }
    }
}

Parameters

Name Type Description Notes
tokenId string The access token ID.

Return type

void (empty response body)

Authorization

Token

HTTP request headers

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

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

GetToken

Token GetToken (string tokenId)

Get a single access token by ID.

Example

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 );
            }
        }
    }
}

Parameters

Name Type Description Notes
tokenId string The access token ID.

Return type

Token

Authorization

Token

HTTP request headers

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

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

GetTokens

Tokens GetTokens (bool? showAll)

Returns a list of tokens in the account.

Example

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 );
            }
        }
    }
}

Parameters

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]

Return type

Tokens

Authorization

Token

HTTP request headers

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

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

PatchToken

Token PatchToken (string tokenId, List patchDelta)

Modify an access token by ID.

Example

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 );
            }
        }
    }
}

Parameters

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/&#39;

Return type

Token

Authorization

Token

HTTP request headers

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

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

PostToken

Token PostToken (TokenBody tokenBody)

Create a new token.

Example

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 );
            }
        }
    }
}

Parameters

Name Type Description Notes
tokenBody TokenBody Create a new access token.

Return type

Token

Authorization

Token

HTTP request headers

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

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

ResetToken

Token ResetToken (string tokenId, long? expiry)

Reset an access token's secret key with an optional expiry time for the old key.

Example

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 );
            }
        }
    }
}

Parameters

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]

Return type

Token

Authorization

Token

HTTP request headers

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

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