# Step 2 – Use Zapier Python to Send Your Question to Maax

**#5 – Format your Zap to look like this. It will differ based on the fields you're sending**

<figure><img src="/files/6jmsgXsopvatuxYt21np" alt=""><figcaption></figcaption></figure>

***

Then... insert a Code by Zapier step, select Python, and copy the following code.

*There are fields that need to be updated by you*

*For more information on **followup\_url**, click ->*  [Follow-up Message Handling](/main/setup-your-integration/v1-customer-ai-zapier/step-2-use-zapier-python-to-send-your-question-to-maax/follow-up-message-handling.md)

<pre class="language-python"><code class="lang-python">import requests

# Fill values
<strong>api_key = # Your API key here
</strong>
url = 'https://app.maax.ai/api/initiate_answer_generation/'
headers = {
<strong>    '2hd-api-key': api_key
</strong>}

service_type = # 'customer_support_automation' or 'sales_automation' 
platform = # sms, email, or website
ai_id = # if sales_ai, input ai_id from your dashboard. If customer_ai, delete line
followup_url = # webhook you set to catch follow-ups from Maax

message_content = input_data['message_content']
phone_number = input_data.get('phone_number', '') 
first_name = input_data.get('first_name', 'unknown')
# End fill values

<strong>data = {
</strong>    'service_type': service_type,
    'platform': platform,
    'ai_id': ai_id,
    'followup_url': followup_url,
    'message_content': message_content,
    'prospect_info': {
        'phone': phone_number,
        'first_name': first_name
    }
}

# POST request
try:
    response = requests.post(url, json=data, headers=headers)
    response.raise_for_status()  
    output = [response.json()]

except requests.exceptions.RequestException as e:
    error_message = str(e)
    output = {"error": error_message}

</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.maax.ai/main/setup-your-integration/v1-customer-ai-zapier/step-2-use-zapier-python-to-send-your-question-to-maax.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
