Users¶
The Users resource provides methods to retrieve information about the authenticated user.
Initialization¶
Before using any resource, initialize the TallyClient:
Get Current User¶
Retrieve information about the authenticated user.
Method¶
Returns¶
User object containing:
id(str): User IDemail(str): User email addressfull_name(str): User's full nameorganization_id(str): Associated organization IDsubscription_plan(SubscriptionPlan): Current subscription plancreated_at(str): Account creation timestamp
Example¶
from tally import Tally
client = Tally(api_key="tly_your_api_key_here")
# Get current user information
user = client.users.me()
print(f"User ID: {user.id}")
print(f"Name: {user.full_name}")
print(f"Email: {user.email}")
print(f"Organization: {user.organization_id}")
print(f"Plan: {user.subscription_plan.value}")
print(f"Member since: {user.created_at}")
Errors¶
| Exception | Status Code | Description |
|---|---|---|
UnauthorizedError |
401 | Invalid or missing API key |
TallyConnectionError |
- | Network connection error |
TallyTimeoutError |
- | Request timeout |
Example with Error Handling¶
from tally import Tally, UnauthorizedError, TallyAPIError
client = Tally(api_key="tly_your_api_key_here")
try:
user = client.users.me()
print(f"Welcome, {user.full_name}!")
except UnauthorizedError:
print("Invalid API key. Please check your credentials.")
except TallyAPIError as e:
print(f"API error: {e.message}")
Models¶
User Model¶
User
dataclass
¶
Represents a Tally user.
Example:
User(
id="usr_abc123",
email="[email protected]",
full_name="John Doe",
organization_id="org_xyz789",
subscription_plan=SubscriptionPlan.PRO,
created_at="2024-01-15T10:30:00Z"
)
SubscriptionPlan¶
SubscriptionPlan ¶
Bases: str, Enum
Tally subscription plans.
Values:
FREE: Free planPRO: Professional planBUSINESS: Business plan
Official API Reference¶
For more details, see the Official Tally API Documentation.
Next Steps¶
- Organizations - Manage organization users and invites
- Forms - Create and manage forms
- Workspaces - Manage workspaces