Skip to content

Latest commit

 

History

History
209 lines (130 loc) · 5.28 KB

File metadata and controls

209 lines (130 loc) · 5.28 KB

\AuthenticationAPI

All URIs are relative to http://localhost

Method HTTP request Description
Authentication Post /api/v1/auth AuthController@checkAuthorization
Login Post /api/v1/auth/login AuthController@login
Register Post /api/v1/auth/register AuthController@register

Authentication

Authentication200Response Authentication(ctx).AuthenticationRequest(authenticationRequest).Execute()

AuthController@checkAuthorization

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/HDRUK/gateway-api-go-sdk"
)

func main() {
	authenticationRequest := *openapiclient.NewAuthenticationRequest() // AuthenticationRequest | Pass user credentials

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

Path Parameters

Other Parameters

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

Name Type Description Notes
authenticationRequest AuthenticationRequest Pass user credentials

Return type

Authentication200Response

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]

Login

Register200Response Login(ctx).LoginRequest(loginRequest).Execute()

AuthController@login

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/HDRUK/gateway-api-go-sdk"
)

func main() {
	loginRequest := *openapiclient.NewLoginRequest() // LoginRequest | Pass user credentials

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

Path Parameters

Other Parameters

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

Name Type Description Notes
loginRequest LoginRequest Pass user credentials

Return type

Register200Response

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]

Register

Register200Response Register(ctx).RegisterRequest(registerRequest).Execute()

AuthController@register

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/HDRUK/gateway-api-go-sdk"
)

func main() {
	registerRequest := *openapiclient.NewRegisterRequest() // RegisterRequest | Pass user registration data

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

Path Parameters

Other Parameters

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

Name Type Description Notes
registerRequest RegisterRequest Pass user registration data

Return type

Register200Response

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]