Skip to content

Latest commit

 

History

History
266 lines (166 loc) · 6.36 KB

AuthAPI.md

File metadata and controls

266 lines (166 loc) · 6.36 KB

\AuthAPI

All URIs are relative to http://localhost:5055/api/v1

Method HTTP request Description
CreateAuthLocal Post /auth/local Sign in using a local account
CreateAuthLogout Post /auth/logout Sign out and clear session cookie
CreateAuthPlex Post /auth/plex Sign in using a Plex token
GetAuthMe Get /auth/me Get logged-in user

CreateAuthLocal

User CreateAuthLocal(ctx).CreateAuthLocalRequest(createAuthLocalRequest).Execute()

Sign in using a local account

Example

package main

import (
	"context"
	"fmt"
	"os"
	overseerrClient "github.com/devopsarr/overseerr-go/overseerr"
)

func main() {
	createAuthLocalRequest := *overseerrClient.NewCreateAuthLocalRequest("Email_example", "Password_example") // CreateAuthLocalRequest | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
createAuthLocalRequest CreateAuthLocalRequest

Return type

User

Authorization

No authorization required

HTTP request headers

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

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

CreateAuthLogout

CreateAuthLogout2XXResponse CreateAuthLogout(ctx).Execute()

Sign out and clear session cookie

Example

package main

import (
	"context"
	"fmt"
	"os"
	overseerrClient "github.com/devopsarr/overseerr-go/overseerr"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

CreateAuthLogout2XXResponse

Authorization

apiKey, cookieAuth

HTTP request headers

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

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

CreateAuthPlex

User CreateAuthPlex(ctx).CreateAuthPlexRequest(createAuthPlexRequest).Execute()

Sign in using a Plex token

Example

package main

import (
	"context"
	"fmt"
	"os"
	overseerrClient "github.com/devopsarr/overseerr-go/overseerr"
)

func main() {
	createAuthPlexRequest := *overseerrClient.NewCreateAuthPlexRequest("AuthToken_example") // CreateAuthPlexRequest | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
createAuthPlexRequest CreateAuthPlexRequest

Return type

User

Authorization

No authorization required

HTTP request headers

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

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

GetAuthMe

User GetAuthMe(ctx).Execute()

Get logged-in user

Example

package main

import (
	"context"
	"fmt"
	"os"
	overseerrClient "github.com/devopsarr/overseerr-go/overseerr"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

User

Authorization

apiKey, cookieAuth

HTTP request headers

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

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