Need Help Integrating Make Webhook

I need help on sending segmented data from the Chat bot to Make…

In this case, I am having the bot summarize the loom video via transcript, and from there, it needs to email the summary to the client…

My VA team just needs to enter in the email and I’d like for it to submit.

I’m not sure how to get the webhook to pull in the specific payload;

Shown is an example.

"content": "This is the body content of the request, explaining the key details.",
"email": "example@domain.com",
"headline": "email headline"

I think if I figure this out, I will have a LOT more use cases similar to this

I was instructed by Mike Gioia to tag @ab2308**

1 Like

@chadvmm something like this?

You are the absolute man. YES! How do I set that up

1 Like

ab2308 is really good at getting it to work, but not so good at showing how he does it. It would take zero extra time to create a loom that we would all benefit from.

I am also struggling with this as well.

@chadvmm please find video and code below

@ihmunro I posted another video in the how-to section. Sorry I have a business to run so I don’t always have time to shoot videos. In any case I hope this one helps.

import os
import requests

def test_video_transcript(summary: str, email: str, headline: str):
    """
    Send summary of the video to the user

    Args:
        summary (string): summary of the video
        email (string): user's email
        headline (string): transcript headline
    Envs:
        MAKE_WEBHOOK (string): make webhook
    """

    # Insert your PYTHON code below. You can access environment variables using os.environ[].
    # Currently, only the requests library is supported, but more libraries will be available soon.
    # Use print statements or return values to display results to the user.
    # If you save a png, pdf, csv, jpg, webp, gif, or html file in the root directory, it will be automatically displayed to the user.
    # You do not have to call this function as the bot will automatically call and fill in the parameters.
    
    # Your Make.com webhook URL
    url = os.environ["MAKE_WEBHOOK"]

    # Payload to send with the request
    payload = {
        "summary": summary,
        "email": email,
        "headline": headline
    }

    # Log payload to verify it
    print("Payload being sent:", payload)

    # Sending the POST request to the webhook URL
    try:
        response = requests.post(url, json=payload, timeout=10)
        
        # Log status code and response content
        print(f"Status code: {response.status_code}")
        print(f"Response content: {response.text}")

        # Check if the request was successful (status code 200-299 are success codes)
        if response.status_code in range(200, 300):
            # Capture response data
            response_data = response.json()
            print("Webhook sent successfully!")
            print("Response from webhook:", response_data)

            # Check if the email was sent correctly
            if response_data.get("message") == "email has been sent correctly":
                print("Email has been confirmed as sent correctly.")
            else:
                print("Email status unclear: ", response_data.get("message", "No message received"))
        
        else:
            # Log failed request details
            print(f"Failed to send webhook. Status code: {response.status_code}, Response: {response.text}")
    
    except requests.exceptions.Timeout:
        print("The request timed out")
    except requests.exceptions.RequestException as e:
        # Handle any request exceptions
        print(f"An error occurred: {e}")
5 Likes

Thank you so much man. I’m going to dive into the video right now. Is it alright if I ping you if I have any secondary questions to this?

Many thanks

Appreciate you doing this real example.

You make it look so easy.

Will try this and let you know how it goes.

Okay so thank you so much! I was able to get the originally requested pickaxe to work which I’m stoked about!

I applied your information to a new PickAxe with a slightly different intent.

On paper, everything works except for the fact that the bot does not RECOGNIZE the webhook action was successful.

Watch more here: Chat bot not recognizing successful Make webhook? | Loom

Ty in advance!

Got everything setup and was working as intended, but then got this error (webhook was setup and running)

Not sure why it is not sending to make.

1 Like

I came across a similar issue but the data was in fact sent to Make even if it was not acknowledging it. The reason was the prompt. Did you change the prompt and did you check if the Make webhook triggered?

@chadvmm the problem is with the prompt.

My understanding is that you want to create an email template and send it to Make rather than sending an email with the bot.The prompt is slightly ambiguous so the bot thinks it needs to send an email other than triggering the action.

Separate the prompt with sections like in my video and avoid phrases like “create an email” or “send an email” as these might be interpreted as actions the bot needs to trigger.

Note this is how LLM prompting works and not something related to the bot / Pickaxe

ROLE

You are an adaptive and proficient assistant, dedicated to taking the information provided and turning it into an Email template for the user.

Your main job is to take the content provided in order to make an Email template.

Please provide the Subject Headline, the Preview Text Headline, and the main content for the email template.

When developing the email template, provoke curiosity for the reader, enhance a storyline when possible, and avoid strong claims.

Don’t include any clickable links in the emails

GOAL

Provide the user with an incredible email template that can be used to turn leads into paying customers.

INSTRUCTIONS

Ask the user if they want to send the information to Make (of note, you are NOT send this email to a user, but rather just firing the information to Make).

Please allow the user to input text here.

@admin_mike … wondering if you could take a quick look here. This thing almost works perfectly… BUT the pickaxe is not recognizing that the MAKE webhook has been SUCCESSFULLY sent, so it’s causing my users to end up filling it out multiple times, ending up frustrated.
My team ends up receiving duplicates of the original request and bogs things down.

Hi @chadvmm,

The problem in your case is that your endpoint does not return a valid json, it returns a text saying “Accepted”.

So doing the following:

response_data = response.json()

causes a problem.

Replace it by response_data = response.text and it should work.

1 Like

You’re a beast! that worked. I guess I’m confused as to when to leave it JSON vs text.

Ty so much

I just rebuilt from scratch again and it is not firing or sending data in the background.

Here is the output again

Please wait while I send the details

It seems there was an error while processing the request. The message indicates a syntax error in the code, specifically in the way the dictionary keys and values are structured.

However, I can still help you with the summary and headline. Here they are once again:

Summary: The animation portrays a stunning transformation where an elegant swan seamlessly merges with a powerful lion, resulting in a majestic swan-lion hybrid. It begins in a serene lake setting, where the swan’s wings envelop the lion, gradually morphing the lion’s mane into a flowing cascade of feathers. The transition beautifully captures the grace of the swan and the strength of the lion, culminating in a regal pose of the hybrid creature.

Headline: “The Majestic Fusion: Witness the Elegant Swan Transform into a Powerful Lion Hybrid!”

Would you like me to attempt sending this data to Make again using your email address iainhmunro@gmail.com?

Here is the code as well

import os
import requests

def video_transcript(summary: str, email: str, headline: str):
“”"
Send details to make

Args:
    summary (string): summary of the transcription
    email (string): email address
    headline (string): transcript headline
Envs:
    MAKE_WEBHOOK (string): Webhook link from Make.com
"""


make_url = os.environ["MAKE_WEBHOOK"]


data_to_send = {
    "summary": summary,
    "email": email,
    "headline"; headline
}

try:

    response = requests.post(make_url, json=data_to_send)
    
    # Check for successful response
    if response.status_code == 200:
        return f"Successfully sent data. Result: {response.text}"
    else:
        return f"Failed to send data to Make. Status code: {response.status_code}, Response: {response.text}"

except Exception as e:
    return f"An error occurred: {str(e)}"

@ihmunro because in the data_to_send you have a semicolon instead of a colon.

2 Likes

Good catch - will review and retry

Still didnt work.

All I get is errors

nothing is going to make