Quickstart Guide
This guide will walk you through creating your first session and retrieving the completed data. You'll have a working integration in under 15 minutes.
Prerequisites
Before you begin, you'll need:
- An ezylegal Partner account
- Your API key (available in the Partner Dashboard)
Step 1: Get Your API Key
- Log in to your Partner Dashboard
- Navigate to Settings → API Keys
- Click Create New Key
- Copy your API key and store it securely
Important: Your API key is a secret. Never expose it in client-side code or public repositories.
Step 2: Create a Session
A session represents a single financial statement collection request. Let's create one:
Using cURL
curl -X POST https://api.ezy-forms.com.au/v1/sessions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"form_type": "financial_statement",
"customer_email": "[email protected]",
"customer_name": "John Smith",
"reference_id": "case-12345",
"webhook_url": "https://yourapp.com/webhooks/ezyfamily"
}'
Using JavaScript
const response = await fetch('https://api.ezy-forms.com.au/v1/sessions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
form_type: 'financial_statement',
customer_email: '[email protected]',
customer_name: 'John Smith',
reference_id: 'case-12345',
webhook_url: 'https://yourapp.com/webhooks/ezyfamily',
}),
});
const session = await response.json();
console.log('Session URL:', session.session_url);
Using Python
import requests
response = requests.post(
'https://api.ezy-forms.com.au/v1/sessions',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'form_type': 'financial_statement',
'customer_email': '[email protected]',
'customer_name': 'John Smith',
'reference_id': 'case-12345',
'webhook_url': 'https://yourapp.com/webhooks/ezyfamily',
},
)
session = response.json()
print(f"Session URL: {session['session_url']}")
Response
{
"id": "sess_abc123xyz",
"status": "pending",
"form_type": "financial_statement",
"customer_email": "[email protected]",
"customer_name": "John Smith",
"reference_id": "case-12345",
"session_url": "https://ezy-forms.com.au/s/abc123xyz",
"created_at": "2024-01-15T10:30:00Z",
"expires_at": "2024-02-14T10:30:00Z"
}
Step 3: Send the Link to Your Customer
The session_url is what your customer uses to complete the form. You can:
- Email it directly to them
- Display it in your application
- Send it via SMS
The link remains valid for 30 days by default.
Step 4: Handle the Webhook
When your customer completes the form, ezylegal sends a webhook to your specified URL:
{
"event": "session.completed",
"session_id": "sess_abc123xyz",
"timestamp": "2024-01-16T14:22:00Z",
"data": {
"status": "completed",
"completed_at": "2024-01-16T14:22:00Z"
}
}
Step 5: Retrieve the Data
Once notified, fetch the completed form data:
curl https://api.ezy-forms.com.au/v1/sessions/sess_abc123xyz/data \
-H "Authorization: Bearer YOUR_API_KEY"
Response:
{
"session_id": "sess_abc123xyz",
"form_type": "financial_statement",
"status": "completed",
"completed_at": "2024-01-16T14:22:00Z",
"data": {
"personal_details": {
"full_name": "John Smith",
"date_of_birth": "1985-03-15",
"address": "123 Main Street, Sydney NSW 2000"
},
"income": {
"employment_income": 95000,
"other_income": 5000,
"total_income": 100000
},
"assets": {
"property": 750000,
"vehicles": 35000,
"savings": 50000,
"superannuation": 180000,
"total_assets": 1015000
},
"liabilities": {
"mortgage": 450000,
"credit_cards": 5000,
"other_loans": 15000,
"total_liabilities": 470000
}
}
}
Step 6: Download the PDF
Get a professionally formatted PDF of the completed form:
curl https://api.ezy-forms.com.au/v1/sessions/sess_abc123xyz/pdf \
-H "Authorization: Bearer YOUR_API_KEY" \
--output financial_statement.pdf
What's Next?
Congratulations! You've completed your first integration. Here are some next steps:
- Authentication Guide - Learn about API key rotation and security
- Webhooks - Configure webhooks and verify signatures
- API Reference - Explore all session options
- Best Practices - Production-ready patterns