All URIs are relative to https://api.ionos.com/auth/v1
Method
HTTP request
Description
TokensDeleteByCriteria
var result DeleteResponse=TokensDeleteByCriteria(ctx) .Criteria(criteria) .XContractNumber(xContractNumber) .Execute()
Delete tokens by criteria
Example
packagemainimport ("context""fmt""os" ionoscloud "github.com/ionos-cloud/sdk-go-auth")funcmain() { criteria := "criteria_example" // string | Delete tokens by criteria EXPIRED, ALL, or CURRENT. The tokens are deleted for the specified contract.
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which the token is generated. (optional)
configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") apiClient := ionoscloud.NewAPIClient(configuration) resource, resp, err := apiClient.TokensApi.TokensDeleteByCriteria(context.Background()).Criteria(criteria).XContractNumber(xContractNumber).Execute()
if err !=nil { fmt.Fprintf(os.Stderr, "Error when calling `TokensApi.TokensDeleteByCriteria``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) }// response from `TokensDeleteByCriteria`: DeleteResponse fmt.Fprintf(os.Stdout, "Response from `TokensApi.TokensDeleteByCriteria`: %v\n", resource)}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to an apiTokensDeleteByCriteriaRequest struct via the builder pattern
var result DeleteResponse=TokensDeleteById(ctx, tokenId) .XContractNumber(xContractNumber) .Execute()
Delete tokens
Example
packagemainimport ("context""fmt""os" ionoscloud "github.com/ionos-cloud/sdk-go-auth")funcmain() { tokenId := "tokenId_example" // string | The Key ID of the token (can be retrieved from the header section of the token).
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which the token is generated. (optional)
configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") apiClient := ionoscloud.NewAPIClient(configuration) resp, err := apiClient.TokensApi.TokensDeleteById(context.Background(), tokenId).XContractNumber(xContractNumber).Execute()
if err !=nil { fmt.Fprintf(os.Stderr, "Error when calling `TokensApi.TokensDeleteById``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) }// response from `TokensDeleteById`: DeleteResponse fmt.Fprintf(os.Stdout, "Response from `TokensApi.TokensDeleteById`: %v\n", resource)}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to an apiTokensDeleteByIdRequest struct via the builder pattern
var result Token=TokensFindById(ctx, tokenId) .XContractNumber(xContractNumber) .Execute()
Get tokens by Key ID
Example
packagemainimport ("context""fmt""os" ionoscloud "github.com/ionos-cloud/sdk-go-auth")funcmain() { tokenId := "tokenId_example" // string | The Key ID of the token (can be retrieved from the header section of the token).
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which the token is generated. (optional)
configuration := ionoscloud.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL") apiClient := ionoscloud.NewAPIClient(configuration) resource, resp, err := apiClient.TokensApi.TokensFindById(context.Background(), tokenId).XContractNumber(xContractNumber).Execute()
if err !=nil { fmt.Fprintf(os.Stderr, "Error when calling `TokensApi.TokensFindById``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp) }// response from `TokensFindById`: Token fmt.Fprintf(os.Stdout, "Response from `TokensApi.TokensFindById`: %v\n", resource)}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to an apiTokensFindByIdRequest struct via the builder pattern