All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
DeleteToken | Delete /api/v2/tokens/{id} | Delete access token |
GetToken | Get /api/v2/tokens/{id} | Get access token |
GetTokens | Get /api/v2/tokens | List access tokens |
PatchToken | Patch /api/v2/tokens/{id} | Patch access token |
PostToken | Post /api/v2/tokens | Create access token |
ResetToken | Post /api/v2/tokens/{id}/reset | Reset access token |
DeleteToken(ctx, id).Execute()
Delete access token
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "id_example" // string | The ID of the access token to update
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AccessTokensApi.DeleteToken(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AccessTokensApi.DeleteToken``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | The ID of the access token to update |
Other parameters are passed through a pointer to a apiDeleteTokenRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Token GetToken(ctx, id).Execute()
Get access token
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "id_example" // string | The ID of the access token
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AccessTokensApi.GetToken(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AccessTokensApi.GetToken``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetToken`: Token
fmt.Fprintf(os.Stdout, "Response from `AccessTokensApi.GetToken`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | The ID of the access token |
Other parameters are passed through a pointer to a apiGetTokenRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Tokens GetTokens(ctx).ShowAll(showAll).Limit(limit).Offset(offset).Execute()
List access tokens
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
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)
limit := int64(789) // int64 | The number of access tokens to return in the response. Defaults to 25. (optional)
offset := int64(789) // int64 | Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AccessTokensApi.GetTokens(context.Background()).ShowAll(showAll).Limit(limit).Offset(offset).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AccessTokensApi.GetTokens``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTokens`: Tokens
fmt.Fprintf(os.Stdout, "Response from `AccessTokensApi.GetTokens`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiGetTokensRequest struct via the builder pattern
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. | |
limit | int64 | The number of access tokens to return in the response. Defaults to 25. | |
offset | int64 | Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Token PatchToken(ctx, id).PatchOperation(patchOperation).Execute()
Patch access token
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "id_example" // string | The ID of the access token to update
patchOperation := []openapiclient.PatchOperation{*openapiclient.NewPatchOperation("replace", "/exampleField")} // []PatchOperation |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AccessTokensApi.PatchToken(context.Background(), id).PatchOperation(patchOperation).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AccessTokensApi.PatchToken``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PatchToken`: Token
fmt.Fprintf(os.Stdout, "Response from `AccessTokensApi.PatchToken`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | The ID of the access token to update |
Other parameters are passed through a pointer to a apiPatchTokenRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
patchOperation | []PatchOperation | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Token PostToken(ctx).AccessTokenPost(accessTokenPost).Execute()
Create access token
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
accessTokenPost := *openapiclient.NewAccessTokenPost() // AccessTokenPost |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AccessTokensApi.PostToken(context.Background()).AccessTokenPost(accessTokenPost).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AccessTokensApi.PostToken``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostToken`: Token
fmt.Fprintf(os.Stdout, "Response from `AccessTokensApi.PostToken`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiPostTokenRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
accessTokenPost | AccessTokenPost |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Token ResetToken(ctx, id).Expiry(expiry).Execute()
Reset access token
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "id_example" // string | The ID of the access token to update
expiry := int64(789) // int64 | An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AccessTokensApi.ResetToken(context.Background(), id).Expiry(expiry).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AccessTokensApi.ResetToken``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ResetToken`: Token
fmt.Fprintf(os.Stdout, "Response from `AccessTokensApi.ResetToken`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | The ID of the access token to update |
Other parameters are passed through a pointer to a apiResetTokenRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
expiry | int64 | An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]