Files
portal/openapi/docs/TokenAPI.md
2026-06-25 11:26:20 +02:00

144 lines
3.9 KiB
Markdown

# \TokenAPI
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**LoginForAccessTokenApiV1TokenPost**](TokenAPI.md#LoginForAccessTokenApiV1TokenPost) | **Post** /api/v1/token | Login For Access Token
[**TestLoginApiV1TestLoginGet**](TokenAPI.md#TestLoginApiV1TestLoginGet) | **Get** /api/v1/test/login | Test Login
## LoginForAccessTokenApiV1TokenPost
> Token LoginForAccessTokenApiV1TokenPost(ctx).Username(username).Password(password).GrantType(grantType).Scope(scope).ClientId(clientId).ClientSecret(clientSecret).Execute()
Login For Access Token
### Example
```go
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.LoginForAccessTokenApiV1TokenPost(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.LoginForAccessTokenApiV1TokenPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `LoginForAccessTokenApiV1TokenPost`: Token
fmt.Fprintf(os.Stdout, "Response from `TokenAPI.LoginForAccessTokenApiV1TokenPost`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiLoginForAccessTokenApiV1TokenPostRequest 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**](Token.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## TestLoginApiV1TestLoginGet
> UserDB TestLoginApiV1TestLoginGet(ctx).Execute()
Test Login
### Example
```go
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.TestLoginApiV1TestLoginGet(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TokenAPI.TestLoginApiV1TestLoginGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `TestLoginApiV1TestLoginGet`: UserDB
fmt.Fprintf(os.Stdout, "Response from `TokenAPI.TestLoginApiV1TestLoginGet`: %v\n", resp)
}
```
### Path Parameters
This endpoint does not need any parameter.
### Other Parameters
Other parameters are passed through a pointer to a apiTestLoginApiV1TestLoginGetRequest struct via the builder pattern
### Return type
[**UserDB**](UserDB.md)
### Authorization
[OAuth2PasswordBearer](../README.md#OAuth2PasswordBearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)