All URIs are relative to https://penapi.pacnetconnect.com
Method | HTTP request | Description |
---|---|---|
generate_token | POST /1.0.0/auth/generatetoken | Create an authentication token |
validate_token | GET /1.0.0/auth/validatetoken | Validate authentication token |
InlineResponse20015 generate_token(grant_type, username, password)
Create an authentication token
from __future__ import print_function
import time
import TelstraTPN
from TelstraTPN.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = TelstraTPN.AuthenticationApi()
grant_type = 'password' # str | (default to 'password')
username = 'username_example' # str |
password = 'password_example' # str |
try:
# Create an authentication token
api_response = api_instance.generate_token(grant_type, username, password)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationApi->generate_token: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
grant_type | str | [default to 'password'] | |
username | str | ||
password | str |
No authorization required
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse20016 validate_token()
Validate authentication token
Validate the authentication token and get information about the user (roles, permissions, etc.)
from __future__ import print_function
import time
import TelstraTPN
from TelstraTPN.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: oAuth2
configuration = TelstraTPN.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = TelstraTPN.AuthenticationApi(TelstraTPN.ApiClient(configuration))
try:
# Validate authentication token
api_response = api_instance.validate_token()
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationApi->validate_token: %s\n" % e)
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]