Skip to content

Latest commit

 

History

History
108 lines (74 loc) · 2.86 KB

AuthenticationApi.md

File metadata and controls

108 lines (74 loc) · 2.86 KB

quetzal.openapi_client.AuthenticationApi

All URIs are relative to https://api.quetz.al/api/v1

Method HTTP request Description
auth_get_token POST /auth/token Login.
auth_logout POST /auth/logout Logout.

auth_get_token

Token auth_get_token()

Login.

Authenticate with simple HTTP authentication and obtain a bearer token. This bearer token can be used on the other endpoints of the API.

Example

  • Basic Authentication (basic):
from __future__ import print_function
import time
import quetzal.openapi_client
from quetzal.openapi_client.rest import ApiException
from pprint import pprint
configuration = quetzal.openapi_client.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = quetzal.openapi_client.AuthenticationApi(quetzal.openapi_client.ApiClient(configuration))

try:
    # Login.
    api_response = api_instance.auth_get_token()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthenticationApi->auth_get_token: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

Token

Authorization

basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

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

auth_logout

auth_logout()

Logout.

Logout by invalidating the existing token.

Example

  • Bearer Authentication (bearer):
from __future__ import print_function
import time
import quetzal.openapi_client
from quetzal.openapi_client.rest import ApiException
from pprint import pprint
configuration = quetzal.openapi_client.Configuration()
# Configure Bearer authorization: bearer
configuration.access_token = 'YOUR_BEARER_TOKEN'

# create an instance of the API class
api_instance = quetzal.openapi_client.AuthenticationApi(quetzal.openapi_client.ApiClient(configuration))

try:
    # Logout.
    api_instance.auth_logout()
except ApiException as e:
    print("Exception when calling AuthenticationApi->auth_logout: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

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

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