# rxfoundry.clients.swifty_oauth_api.OAuthApi All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [**get_token**](OAuthApi.md#get_token) | **POST** /oauth/token/ | Get a token [**get_user_info**](OAuthApi.md#get_user_info) | **POST** /oauth/userinfo/ | Get user info # **get_token** > TokenResponse get_token(get_token_request) Get a token ### Example ```python import rxfoundry.clients.swifty_oauth_api from rxfoundry.clients.swifty_oauth_api.models.get_token_request import GetTokenRequest from rxfoundry.clients.swifty_oauth_api.models.token_response import TokenResponse from rxfoundry.clients.swifty_oauth_api.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = rxfoundry.clients.swifty_oauth_api.Configuration( host = "http://localhost" ) # Enter a context with an instance of the API client with rxfoundry.clients.swifty_oauth_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = rxfoundry.clients.swifty_oauth_api.OAuthApi(api_client) get_token_request = rxfoundry.clients.swifty_oauth_api.GetTokenRequest() # GetTokenRequest | try: # Get a token api_response = api_instance.get_token(get_token_request) print("The response of OAuthApi->get_token:\n") pprint(api_response) except Exception as e: print("Exception when calling OAuthApi->get_token: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **get_token_request** | [**GetTokenRequest**](GetTokenRequest.md)| | ### Return type [**TokenResponse**](TokenResponse.md) ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | A token | - | **400** | Invalid request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_user_info** > UserInfoResponse get_user_info() Get user info ### Example * Bearer (opaque) Authentication (opaque_token): ```python import rxfoundry.clients.swifty_oauth_api from rxfoundry.clients.swifty_oauth_api.models.user_info_response import UserInfoResponse from rxfoundry.clients.swifty_oauth_api.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = rxfoundry.clients.swifty_oauth_api.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure Bearer authorization (opaque): opaque_token configuration = rxfoundry.clients.swifty_oauth_api.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with rxfoundry.clients.swifty_oauth_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = rxfoundry.clients.swifty_oauth_api.OAuthApi(api_client) try: # Get user info api_response = api_instance.get_user_info() print("The response of OAuthApi->get_user_info:\n") pprint(api_response) except Exception as e: print("Exception when calling OAuthApi->get_user_info: %s\n" % e) ``` ### Parameters This endpoint does not need any parameter. ### Return type [**UserInfoResponse**](UserInfoResponse.md) ### Authorization [opaque_token](../README.md#opaque_token) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | User info | - | **400** | Invalid request | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)