# Step 4 – Get the Answer

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

<figure><img src="https://468569185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJl2zftYmeGMrSkfkRKrj%2Fuploads%2Fl7DVdGAVLoQCFIgfJLO3%2Fimage.png?alt=media&#x26;token=9e7618d1-6a97-46d5-85a4-6c169d87baa0" alt=""><figcaption></figcaption></figure>

***

```python
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}

```
