Files
portal/openapi/docs/TokenAPI.md
2026-06-22 11:38:29 +02:00

3.8 KiB

\TokenAPI

All URIs are relative to http://localhost

Method HTTP request Description
LoginForAccessTokenTokenPost Post /token Login For Access Token
TestLoginTestLoginGet Get /test/login Test Login

LoginForAccessTokenTokenPost

Token LoginForAccessTokenTokenPost(ctx).Username(username).Password(password).GrantType(grantType).Scope(scope).ClientId(clientId).ClientSecret(clientSecret).Execute()

Login For Access Token

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
	username := "username_example" // string | 
	password := "password_example" // string | 
	grantType := "grantType_example" // string |  (optional)
	scope := "scope_example" // string |  (optional) (default to "")
	clientId := "clientId_example" // string |  (optional)
	clientSecret := "clientSecret_example" // string |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TokenAPI.LoginForAccessTokenTokenPost(context.Background()).Username(username).Password(password).GrantType(grantType).Scope(scope).ClientId(clientId).ClientSecret(clientSecret).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TokenAPI.LoginForAccessTokenTokenPost``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `LoginForAccessTokenTokenPost`: Token
	fmt.Fprintf(os.Stdout, "Response from `TokenAPI.LoginForAccessTokenTokenPost`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiLoginForAccessTokenTokenPostRequest struct via the builder pattern

Name Type Description Notes
username string
password string
grantType string
scope string [default to ""]
clientId string
clientSecret string

Return type

Token

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

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

TestLoginTestLoginGet

UserDB TestLoginTestLoginGet(ctx).Execute()

Test Login

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.TokenAPI.TestLoginTestLoginGet(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `TokenAPI.TestLoginTestLoginGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `TestLoginTestLoginGet`: UserDB
	fmt.Fprintf(os.Stdout, "Response from `TokenAPI.TestLoginTestLoginGet`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiTestLoginTestLoginGetRequest struct via the builder pattern

Return type

UserDB

Authorization

OAuth2PasswordBearer

HTTP request headers

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

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