Skip to main content

Alert Team About New Contact

📣 Quickstart Guide - Alert Team About New Contact

Learn how to chain multiple API calls with Fiscus SDK to create a more complex workflow.

How to Chain Events with Fiscus SDK

Turn natural language into powerful multi-step API operations. Follow these steps to orchestrate API calls and dynamically route tasks between multiple services.

What you’ll achieve: By the end of this guide, you’ll chain multiple API operations to create a workflow using the Fiscus SDK.

1. Install Fiscus SDK

Install Packages

pip install fiscus

2. Connect Your APIs (e.g., CRM and Project Management Tool)

Integrate with multiple APIs quickly:

from fiscus import FiscusClient

# Initialize the Fiscus client with your API key and user_id
client = FiscusClient(api_key='YOUR_FISCUS_API_KEY', user_id='user_123')

# Add the CRM and Project Management connectors (e.g., HubSpot and Trello)
client.user.add_connector('HubSpot')
client.user.add_connector('Trello')

# Authenticate both connectors
client.user.authenticate_connector('HubSpot')
client.user.authenticate_connector('Trello')

3. Define a Workflow to Create a New Contact and Notify a Team

Create a task that adds a new contact to the CRM and then notifies the team via Trello:

# Define the task to create a contact in CRM and send a notification in Trello
tasks = [
{
'connector': 'HubSpot',
'operation': 'create_contact',
'params': {
'first_name': 'John',
'last_name': 'Doe',
'email': 'johndoe@example.com',
'phone': '555-555-5555'
}
},
{
'connector': 'Trello',
'operation': 'create_card',
'params': {
'board_id': 'your_board_id',
'list_id': 'your_list_id',
'name': 'New Contact Added: John Doe',
'desc': 'A new contact has been added to the CRM system.'
}
}
]

# Execute the chained tasks
response = client.execute(tasks=tasks)

print(response)

4. Handle Responses from Multiple APIs

Check the response of both tasks:

# Handle responses from the executed tasks
for task_response in response:
if task_response.success:
print(f"{task_response.connector} task '{task_response.operation}' executed successfully!")
else:
print(f"Error in {task_response.connector} task '{task_response.operation}': {task_response.error_message}")

 

Look at That! 🎉

Success! You’ve now:

🔐 Authenticated your CRM and project management API accounts with Fiscus SDK
🛠 Created a new contact in your CRM system
🔄 Set up a multi-step workflow to automate the handoff between the CRM and project management tools
🧠 Automatically created a Trello card to notify your team about the new contact
✅ Successfully executed a multi-step workflow, connecting your CRM and Trello APIs