👋  Let's catch a webhook from Structurely and add it to your Contactually CRM

🌟 (TL;DR)🌟
You'll need a Zapier account and a Structurely account - and it'll help to know how to write code (Python will be used in this documentation)

👉  Go to your Zapier account and click "Make a New Zap"

TRIGGER

👉  Search and select the "Webhooks" Zapier Trigger 👇 

👉  Select "Catch Hook" for your Trigger Step 👇 

👉  Zapier will provide you a custom URL - click "Copy" 👇 

❗ NOTE: You will need to send the Structurely Team this unique URL - you can do so through the live chat, or send the URL to nate@structurely.com ❗ 

👉  Click "OK, I did this" after you've sent the URL to the Structurely team 👆 

👉  Structurely will send a test message through to your Structurely account - when they do that, go to the "Pull in Samples" tab and click "See More Samples" - you will see the latest message Structurely sent through as a test. Then click that sample (likely will be Sample A) and click "Continue"👇

 

ACTION

👉  Search and Select "Code" for your Action step 👇 

👉  Select the type of code you will run - for this example, we will be choosing the "Run Python" - then click "Continue"👇 

👉  Add and copy the names for the following fields👇 

👉  Use the following fields to populate the values in the step above (this is what's highlighted in green above)👇 

👉  Add the following code to the code field👇

COPY  THE CODE HERE

def parse_value(data):
    try:
        return eval(data)
    except:
        return data.strip()


def parse_list(data):
    values = []
    current_value = {}

    for line in data.split('\n'):
        if ':' not in line:
            continue

        key, value = line.split(':', 1)

        if key in current_value:
            values.append(current_value)
            current_value = {}

        current_value[key] = parse_value(value)

    values.append(current_value)

    return values


name = input_data['name']
email = input_data['email']
devices = parse_list(input_data['devices'])
messages = parse_list(input_data['messages'])

return {
    'name': name,
    'email': email,
    'phoneNumber': devices[0]['info']['phoneNumber'],
    'messageText': messages[0]['text'],
    'received': messages[0]['received']
}

👉  After you've added the above code, click "Continue" 👆 

👉  Click "Test this step"  - you should get results that look similar to below 👇 

ACTION - CONTACTUALLY

👉  Now, search and select Contactually Zapier app for this Action step and click Continue👇 

👉  Select the "Find Contact" Search action. Click Continue 👇 

👉  Connect your Contactually account👇

👉  Now, find the "Search Query" field and click the add icon on the right of the field -- -- then search for "email" and select the bottom option containing your lead's email 👇 

👉Now add a new step 👇

👉Select the "Action/Search" step 👇

👉Search for and select Conctactually 👇

👉Select the "Create Interaction" action 👇

👉Connect your Contactually account👇

👉In the Participant ID field, select the dropdown and choose "Use a Custom Field (advanced)" -- Then in the "Custom Value for Participant ID ID" field click the add icon on the right, then search for "participant" -- choose the "Participant ID" from the previous Find Contact step👇

👉In the Participant Handle field, click the add icon on the right, then search email, use the email from the previous search step 👇

👉In the Content field, click the add icon on the right, then search "Message" -- choose the "Message Text" field from the Python code step👇

👉In the Occurred At field, click the add icon on the right, then search "Received" -- choose the "Received" field from the Python code step 👇

👉Your fields should match below 👇

🎊 Congrats! Now every time Aisa Holmes, an agent or the lead responds in your Structurely HomeChat, that message will be added as a note in the Lead Profile of that same lead in Contactually

If you have any questions setting up this process reach out to nate@structurely.com

Happy closings!
🚀 The Structurely Team

Did this answer your question?