All URIs are relative to https://api.ynab.com/v1
Method | HTTP request | Description |
---|---|---|
get_user | GET /user | User info |
UserResponse get_user()
User info
Returns authenticated user information
- Bearer Authentication (bearer):
import ynab
from ynab.models.user_response import UserResponse
from ynab.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.ynab.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = ynab.Configuration(
host = "https://api.ynab.com/v1"
)
# 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: bearer
configuration = ynab.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with ynab.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ynab.UserApi(api_client)
try:
# User info
api_response = api_instance.get_user()
print("The response of UserApi->get_user:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UserApi->get_user: %s\n" % e)
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | The user info | - |
0 | An error occurred | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]