Quick Start¶
This guide will help you get started with the Bloomy Python SDK in just a few minutes.
Step 1: Get Your API Key¶
First, you'll need an API key from Bloom Growth. You can obtain it using the Token endpoint:
curl -i -X POST -d "grant_type=password" \
-d "userName=YOUR_USERNAME_HERE" \
-d "password=YOUR_PASSWORD_HERE" \
'https://app.bloomgrowth.com/Token'
The response will include an access_token
field which is your API key.
Step 2: Configure Authentication¶
There are three ways to provide your API key:
Option 1: Direct Initialization (Recommended for Scripts)¶
Option 2: Environment Variable (Recommended for Applications)¶
Set the environment variable:
Then initialize without parameters:
Option 3: Configuration File (Recommended for Development)¶
Save your credentials using the configuration helper:
from bloomy import Configuration
# Save credentials
config = Configuration()
config.configure_api_key(
username="your-email@example.com",
password="your-password",
store_key=True
)
# Now you can use the client without any parameters
from bloomy import Client
client = Client()
Step 3: Make Your First API Call¶
Let's verify everything is working by fetching your user information:
from bloomy import Client
# Initialize client
client = Client(api_key="your-api-key")
# Get current user
me = client.user.details()
print(f"Logged in as: {me.name}")
# List your meetings
meetings = client.meeting.list()
print(f"\nYou have {len(meetings)} meetings:")
for meeting in meetings[:5]: # Show first 5
print(f" - {meeting.name}")
import asyncio
from bloomy import AsyncClient
async def main():
# Initialize async client
async with AsyncClient(api_key="your-api-key") as client:
# Get current user
me = await client.user.details()
print(f"Logged in as: {me.name}")
# List your meetings
meetings = await client.meeting.list()
print(f"\nYou have {len(meetings)} meetings:")
for meeting in meetings[:5]: # Show first 5
print(f" - {meeting.name}")
asyncio.run(main())
Step 4: Explore Common Operations¶
Working with Todos¶
# List your todos
todos = client.todo.list()
open_todos = [t for t in todos if not t.complete]
print(f"You have {len(open_todos)} open todos")
# Create a new todo (requires meeting_id)
meeting_id = meetings[0].id
new_todo = client.todo.create(
title="Complete quarterly review",
meeting_id=meeting_id,
due_date="2024-12-31",
notes="Review all Q4 metrics and prepare summary"
)
print(f"Created todo: {new_todo.name} (ID: {new_todo.id})")
Working with Goals (Rocks)¶
# List your active goals
goals = client.goal.list()
for goal in goals:
print(f"Goal: {goal.title} - {goal.status}")
# Create a new goal (requires meeting_id)
meeting_id = meetings[0].id
new_goal = client.goal.create(
title="Launch new product feature",
meeting_id=meeting_id
)
Bulk Operations¶
Create multiple items at once with detailed error handling:
# Create multiple todos in one operation
todos = [
{"title": "Review sales report", "meeting_id": meeting_id},
{"title": "Update CRM data", "meeting_id": meeting_id},
{"title": "Send follow-up emails", "meeting_id": meeting_id}
]
result = client.todo.create_many(todos)
print(f"Created {len(result.successful)} todos successfully")
if result.failed:
print(f"Failed to create {len(result.failed)} todos:")
for failure in result.failed:
print(f" - {failure.input_data['title']}: {failure.error}")
Working with Meetings¶
# Get a specific meeting's details
meeting_id = meetings[0].id
meeting = client.meeting.details(meeting_id)
# Get meeting attendees
attendees = client.meeting.attendees(meeting_id)
print(f"Meeting has {len(attendees)} attendees")
# Add a headline to the meeting
headline = client.headline.create(
meeting_id=meeting_id,
title="Team exceeded Q4 sales target by 15%",
notes="Great job everyone!"
)
Using Context Managers¶
Both clients support context managers for automatic resource cleanup:
Error Handling¶
Always handle potential errors when making API calls:
from bloomy import Client, BloomyError, APIError
client = Client(api_key="your-api-key")
try:
user = client.user.details()
except APIError as e:
print(f"API error: {e} (Status: {e.status_code})")
except BloomyError as e:
print(f"SDK error: {e}")
Next Steps¶
- Read the Configuration Guide for more authentication options
- Explore the API Reference for all available operations
- Check out the User Guide for advanced usage patterns
- Learn about Bulk Operations for efficient batch processing