All URIs are relative to https://api.forestvpn.com/v2
Method | HTTP request | Description |
---|---|---|
AuthorizeAccessTokenRequest | Post /auth/access-token-requests/{requestID}/authorize/ | Authorize access token request |
CreateAccessTokenRequest | Post /auth/access-token-requests/ | Create access token request |
GetAccessTokenRequest | Get /auth/access-token-requests/{requestID}/ | Get access token request details |
LoginToken | Post /auth/token/login/ | Login with JWT token |
MigrateLegacyAuth | Get /legacy/auth/ | Legacy auth migration |
ObtainToken | Get /auth/token/obtain/ | Obtain JWT token |
RevokeAccessTokenRequest | Post /auth/access-token-requests/{requestID}/revoke/ | Revoke access token request |
UpdateUserProfile | Patch /auth/profile/ | Update profile |
UserProfile | Get /auth/profile/ | Profile |
WhoAmI | Get /auth/whoami/ | Who am I |
AccessTokenRequest AuthorizeAccessTokenRequest(ctx, requestID).Execute()
Authorize access token request
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
requestID := "requestID_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AuthApi.AuthorizeAccessTokenRequest(context.Background(), requestID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.AuthorizeAccessTokenRequest``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AuthorizeAccessTokenRequest`: AccessTokenRequest
fmt.Fprintf(os.Stdout, "Response from `AuthApi.AuthorizeAccessTokenRequest`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
requestID | string |
Other parameters are passed through a pointer to a apiAuthorizeAccessTokenRequestRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AccessTokenRequest CreateAccessTokenRequest(ctx).Name(name).Execute()
Create access token request
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
name := "name_example" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AuthApi.CreateAccessTokenRequest(context.Background()).Name(name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.CreateAccessTokenRequest``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateAccessTokenRequest`: AccessTokenRequest
fmt.Fprintf(os.Stdout, "Response from `AuthApi.CreateAccessTokenRequest`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateAccessTokenRequestRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
name | string |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AccessTokenRequest GetAccessTokenRequest(ctx, requestID).Execute()
Get access token request details
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
requestID := "requestID_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AuthApi.GetAccessTokenRequest(context.Background(), requestID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.GetAccessTokenRequest``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAccessTokenRequest`: AccessTokenRequest
fmt.Fprintf(os.Stdout, "Response from `AuthApi.GetAccessTokenRequest`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
requestID | string |
Other parameters are passed through a pointer to a apiGetAccessTokenRequestRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TokenLogin LoginToken(ctx).CreateTokenLogin(createTokenLogin).Execute()
Login with JWT token
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
createTokenLogin := *openapiclient.NewCreateTokenLogin("JwtToken_example") // CreateTokenLogin | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AuthApi.LoginToken(context.Background()).CreateTokenLogin(createTokenLogin).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.LoginToken``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `LoginToken`: TokenLogin
fmt.Fprintf(os.Stdout, "Response from `AuthApi.LoginToken`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiLoginTokenRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
createTokenLogin | CreateTokenLogin |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LegacyAuthMigrationToken MigrateLegacyAuth(ctx).Execute()
Legacy auth migration
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AuthApi.MigrateLegacyAuth(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.MigrateLegacyAuth``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `MigrateLegacyAuth`: LegacyAuthMigrationToken
fmt.Fprintf(os.Stdout, "Response from `AuthApi.MigrateLegacyAuth`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiMigrateLegacyAuthRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TokenObtain ObtainToken(ctx).Execute()
Obtain JWT token
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AuthApi.ObtainToken(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.ObtainToken``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ObtainToken`: TokenObtain
fmt.Fprintf(os.Stdout, "Response from `AuthApi.ObtainToken`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiObtainTokenRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AccessTokenRequest RevokeAccessTokenRequest(ctx, requestID).Execute()
Revoke access token request
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
requestID := "requestID_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AuthApi.RevokeAccessTokenRequest(context.Background(), requestID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.RevokeAccessTokenRequest``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RevokeAccessTokenRequest`: AccessTokenRequest
fmt.Fprintf(os.Stdout, "Response from `AuthApi.RevokeAccessTokenRequest`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
requestID | string |
Other parameters are passed through a pointer to a apiRevokeAccessTokenRequestRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
User UpdateUserProfile(ctx).User(user).Execute()
Update profile
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
user := *openapiclient.NewUser("Id_example", "Username_example") // User | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AuthApi.UpdateUserProfile(context.Background()).User(user).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.UpdateUserProfile``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateUserProfile`: User
fmt.Fprintf(os.Stdout, "Response from `AuthApi.UpdateUserProfile`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiUpdateUserProfileRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
user | User |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
User UserProfile(ctx).Execute()
Profile
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AuthApi.UserProfile(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.UserProfile``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UserProfile`: User
fmt.Fprintf(os.Stdout, "Response from `AuthApi.UserProfile`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiUserProfileRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
User WhoAmI(ctx).Execute()
Who am I
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AuthApi.WhoAmI(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.WhoAmI``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `WhoAmI`: User
fmt.Fprintf(os.Stdout, "Response from `AuthApi.WhoAmI`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiWhoAmIRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]