All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| login | POST /auth/login | |
| o_auth2_client_credentials | POST /oauth2/token | Issue an OAuth 2.0 access token (Client Credentials) |
Login200Response login(login_request)
Gets an API key from username and password
import notehub_py
from notehub_py.models.login200_response import Login200Response
from notehub_py.models.login_request import LoginRequest
from notehub_py.rest import ApiException
from pprint import pprint
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.AuthorizationApi(api_client)
login_request = {
"password": "test-password",
"username": "name@example.com",
} # LoginRequest |
try:
api_response = api_instance.login(login_request)
print("The response of AuthorizationApi->login:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AuthorizationApi->login: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| login_request | LoginRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
OAuth2TokenResponse o_auth2_client_credentials(client_id, client_secret, grant_type, scope=scope)
Issue an OAuth 2.0 access token (Client Credentials)
Exchanges client credentials for an access token. Parameters must be sent as application/x-www-form-urlencoded.
import notehub_py
from notehub_py.models.o_auth2_token_response import OAuth2TokenResponse
from notehub_py.rest import ApiException
from pprint import pprint
# Enter a context with an instance of the API client
with notehub_py.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = notehub_py.AuthorizationApi(api_client)
client_id = "client_id_example" # str |
client_secret = "client_secret_example" # str |
grant_type = "grant_type_example" # str |
scope = "scope_example" # str | Space-delimited scopes. (optional)
try:
# Issue an OAuth 2.0 access token (Client Credentials)
api_response = api_instance.o_auth2_client_credentials(
client_id, client_secret, grant_type, scope=scope
)
print("The response of AuthorizationApi->o_auth2_client_credentials:\n")
pprint(api_response)
except Exception as e:
print(
"Exception when calling AuthorizationApi->o_auth2_client_credentials: %s\n"
% e
)| Name | Type | Description | Notes |
|---|---|---|---|
| client_id | str | ||
| client_secret | str | ||
| grant_type | str | ||
| scope | str | Space-delimited scopes. | [optional] |
No authorization required
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json