TokensApi
All URIs are relative to https://api.ionos.com/auth/v1
TokensDeleteByCriteria
var result DeleteResponse = TokensDeleteByCriteria(ctx)
.Criteria(criteria)
.XContractNumber(xContractNumber)
.Execute()Delete tokens by criteria
Example
package main
import (
"context"
"fmt"
"os"
auth "github.com/ionos-cloud/sdk-go-bundle/products/auth"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
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 := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := auth.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
criteria
string
Delete tokens by criteria EXPIRED, ALL, or CURRENT. The tokens are deleted for the specified contract.
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which the token is generated.
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
TokensDeleteById
Delete tokens
Example
Path Parameters
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
tokenId
string
The Key ID of the token (can be retrieved from the header section of the token).
Other Parameters
Other parameters are passed through a pointer to an apiTokensDeleteByIdRequest struct via the builder pattern
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which the token is generated.
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
TokensFindById
Get tokens by Key ID
Example
Path Parameters
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
tokenId
string
The Key ID of the token (can be retrieved from the header section of the token).
Other Parameters
Other parameters are passed through a pointer to an apiTokensFindByIdRequest struct via the builder pattern
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which the token is generated.
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
TokensGenerate
Create new tokens
Example
Path Parameters
Other Parameters
Other parameters are passed through a pointer to an apiTokensGenerateRequest struct via the builder pattern
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which the token is generated.
ttl
int32
The maximum time that the access token will be valid for use within the application in seconds.
[default to 31536000]
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
TokensGet
List all tokens
Example
Path Parameters
Other Parameters
Other parameters are passed through a pointer to an apiTokensGetRequest struct via the builder pattern
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which the token is generated.
Return type
HTTP request headers
Content-Type: Not defined
Accept: application/json
Last updated
