Skip to content

Latest commit

 

History

History
106 lines (70 loc) · 3.06 KB

AuthenticationApi.md

File metadata and controls

106 lines (70 loc) · 3.06 KB

tvdb_api.AuthenticationApi

All URIs are relative to https://localhost

Method HTTP request Description
login_post POST /login
refresh_token_get GET /refresh_token

login_post

Token login_post(authentication_string)

Returns a session token to be included in the rest of the requests. Note that API key authentication is required for all subsequent requests and user auth is required for routes in the User section

Example

from __future__ import print_function
import time
import tvdb_api
from tvdb_api.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = tvdb_api.AuthenticationApi()
authentication_string = tvdb_api.Auth() # Auth | JSON string containing your authentication details.

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

Parameters

Name Type Description Notes
authentication_string Auth JSON string containing your authentication details.

Return type

Token

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]

refresh_token_get

Token refresh_token_get()

Refreshes your current, valid JWT token and returns a new token. Hit this route so that you do not have to post to /login with your API key and credentials once you have already been authenticated.

Example

from __future__ import print_function
import time
import tvdb_api
from tvdb_api.rest import ApiException
from pprint import pprint

# Configure API key authorization: jwtToken
configuration = tvdb_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

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

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

Parameters

This endpoint does not need any parameter.

Return type

Token

Authorization

jwtToken

HTTP request headers

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

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