Skip to content

Latest commit

 

History

History
85 lines (56 loc) · 2.46 KB

AccountApi.md

File metadata and controls

85 lines (56 loc) · 2.46 KB

flat_api.AccountApi

All URIs are relative to https://api.flat.io/v2

Method HTTP request Description
get_authenticated_user GET /me Get current user account

get_authenticated_user

UserDetails get_authenticated_user(only_id=only_id)

Get current user account

Get details about the current authenticated User.

Example

  • OAuth Authentication (OAuth2):
import flat_api
from flat_api.models.user_details import UserDetails
from flat_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.flat.io/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = flat_api.Configuration(
    host = "https://api.flat.io/v2"
)

# 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.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with flat_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = flat_api.AccountApi(api_client)
    only_id = False # bool | Only return the user id (optional) (default to False)

    try:
        # Get current user account
        api_response = api_instance.get_authenticated_user(only_id=only_id)
        print("The response of AccountApi->get_authenticated_user:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AccountApi->get_authenticated_user: %s\n" % e)

Parameters

Name Type Description Notes
only_id bool Only return the user id [optional] [default to False]

Return type

UserDetails

Authorization

OAuth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Current user details -
0 Error -

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