⚙️
Maax AI Documentation
  • Start Here
    • ▶️Welcome to Maax
      • How does it work?
        • Integrations
        • Dataflow
      • Accessing your account
    • 📚Setting Up Your Knowledge Base
      • Uploading Content
        • Upload Best Practices
      • Testing Responses
    • 💻Web App (Dashboard)
      • Maax AI Setup
        • Upload Content
        • Student Support
        • Sales
      • Leaving Feedback on Conversations
  • Setup Your AI
    • 💸Sales AI
      • 1. Product
        • 1a. Update Knowledge Base
        • 1b. Create a Product Description
      • 2. Strategy
      • 3. Goal and Goal URL
      • 4. Creating Your Sales AI
    • 🦸‍♂️Customer Support AI
      • Emergency Notification Setting
  • 🔄Setup Your Integration
    • V2 Sales AI - Zapier
      • 1. Send Question to Maax
      • 1a. Explanation of Python Code Step
      • 2. Catch and Map Response From Maax
      • 3. Catch and Map Follow Ups
      • 4. Set up Emergency Notifications
    • V1 Customer AI - Zapier
      • Step 1 – Starting your Zap
      • Step 2 – Use Zapier Python to Send Your Question to Maax
        • Follow-up Message Handling
      • Step 3 – Delay Your Request
      • Step 4 – Get the Answer
      • Step 5 – Map the Answer
    • Example Use Cases
      • Gmail Customer Support Automation with Zapier
  • Technical Guides
    • 🔗APIs
      • V1
        • Authentication
        • Base Url
        • Conversations
        • Products
        • Strategies
        • Goals
        • Sales AIs
      • V2
        • Authentication
        • Base Url
        • Outgoing Messages
        • Conversations
    • 🍇Explanatory Diagrams
      • Advanced - MAAX AI API Model Architecture
      • Answer Generation With MAAX AI
  • 💬 Building Good Prompts
    • [Use Case] Engage Cart Abandons
Powered by GitBook
On this page
  1. Setup Your Integration
  2. V1 Customer AI - Zapier

Step 4 – Get the Answer

Trigger a GET request

PreviousStep 3 – Delay Your RequestNextStep 5 – Map the Answer

Last updated 1 year ago

Create another Code by Zapier (Python) step and copy + paste the code below. It needs to receive the incoming_message_id field from Step 2 as an input


import requests

# Fill value
api_key = # your API key here

# URL and headers
url = 'https://app.maax.ai/api/retrieve_answer/'
headers = {
    'Content-Type': 'application/json',  
    '2hd-api-key': api_key
}

# Fill value
service_type = # 'customer_service_automation' or 'sales_automation'
incoming_message_id = input_data['incoming_message_id']

# Define payload
payload = {  
    'incoming_message_id': incoming_message_id,  
    'service_type': service_type 
}

# GET request
try:
    response = requests.get(url, headers=headers, params=payload)
    # Raise an exception if an HTTP error occurred
    response.raise_for_status()  
    output = [response.json()]
except requests.exceptions.RequestException as e:
    # Handle any error that may have occurred
    error_message = str(e)
    output = {"error": error_message}
🔄