3.9 KiB
3.9 KiB
\TokenAPI
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| LoginForAccessTokenApiV1TokenPost | Post /api/v1/token | Login For Access Token |
| 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
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
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]
TestLoginApiV1TestLoginGet
UserDB TestLoginApiV1TestLoginGet(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.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
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]