Webhook Data Sent To Pabbly Returned To Pickax

Could you help us understand how to return output (several sections of text) from a Pabbly Workflow that was initially triggered by a Pickaxe webhook.

3 Likes

Here is a Video of my Pickaxe (AI Keyword Machine PABBLY)

Pabbly Connect Support Advised using an API Step at the end of the workflow to return the information. Here is a screenshot of the Pabbly Connect Step. My question now is how to onfigure the API Step per Pickaxe (Awesome Screenshot).

@admin_mike

Cheers,
JP

1 Like

Do you have a webhook response to send back the data ?

1 Like

@Agency-Skip PIckaxe doesn’t have APIs your can point to. You need to set up the webhook response to your original call. I don’t know Pabbly but there must be an option to set up a response when you create the webhook URL that you enter in the Pickaxe action or a response module that you can add as part of your Pabbly flow

2 Likes

thank you for this response - I am now asking Pabbly Support for guidance on returning the webhook data upon workflow completion!

2 Likes

For community reference!!! The answer from Pabbly is to use the Data Forwarder action step at the end of the workflow.
https://tinyurl.com/25qhe77w

2 Likes

I also have Pabbly and wanted to know how to do this. It looks like we still don’t have access to the PickAxe API, but is there a way to send back our data through the original webhook to our PickAxes?

If not, with the Data Forwarder action, how do we send the information back to our PickAxe exactly? If you use JSON, then what JSON do we put in our PickAxe to make sure it sends it back to the right place with the right data?

For example, if I were doing Google Maps driving directions as the step before with origin and destination and travel mode as driving, what would that look like in Pabbly Data forwarder in JSON? Then, what would I put exactly, and where would I put it in my custom PickAxe via JSON embedded? @ihmunro @ab2308 @Agency-Skip

All you need to do is add a webhook response and add the code to send it back after the scenario runs.

1 Like

@rainmaker this is a basic Make webhook with response action. You will need to customise this for Pabbly

import requests

def make_with_response_source_question(question: str):
    """
    Sends a question to Make and wait for the reposne

    Args:
        question (string): user's question
    """

    # 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 = "YOUR_WEBHOOK_URL"  # Replace with the actual webhook URL

    # Payload containing only the Client ID
    payload = {
        "question": question
    }

    # Log the payload to verify the request data
    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
        if response.status_code == 200:
            try:
                # Parse the JSON response
                response_data = response.json()
                
                # Extract the name and visa status
                name = response_data.get("name", "No name received")
                visa_status = response_data.get("visa_status", "No status update received")
                
                # Log the received data
                print("info:", info)
                
                
                # Return the extracted data as a dictionary
                return {
                    "info": info,
                    
                }
            except ValueError:
                # Handle case where response is not valid JSON
                print("Failed to parse JSON response")
                return None
        else:
            print(f"Failed to send webhook. Status code: {response.status_code}, Response: {response.text}")
            return None

    except requests.exceptions.Timeout:
        print("The request timed out")
        return None
    except requests.exceptions.RequestException as e:
        # Handle any request exceptions
        print(f"An error occurred: {e}")
        return None
1 Like

@ab2308, is there an easier way to do this, or do I have to put the JSON code in there(Pabbly Data forwarder only way without PickAxe API?)? Also, I don’t need all the other Google Maps stuff (origin, destination, etc.), Google Maps API key (already in Pabbly), etc.. I need to put the Pabbly webhook URL in the placeholder, and I am good to go?

Here is what I came up with so far:

import requests

def pabbly_with_google_maps(question: str, origin: str, destination: str, google_api_key: str):
“”"
Sends a question to Pabbly.com and retrieves Google Maps Driving Directions.

Args:
    question (str): User's question for Pabbly.com.
    origin (str): Starting location for driving directions.
    destination (str): Destination location for driving directions.
    google_api_key (str): Google Maps API Key.
"""

# Pabbly.com Webhook URL
pabbly_url = "YOUR_PABBLY_WEBHOOK_URL"  # Replace with the actual Pabbly webhook URL

# Payload for Pabbly webhook
pabbly_payload = {
    "question": question
}

# Log the payload to verify the request data
print("Payload being sent to Pabbly:", pabbly_payload)

try:
    # Sending POST request to Pabbly webhook
    pabbly_response = requests.post(pabbly_url, json=pabbly_payload, timeout=10)

    print(f"Pabbly Status code: {pabbly_response.status_code}")
    print(f"Pabbly Response content: {pabbly_response.text}")

    if pabbly_response.status_code == 200:
        try:
            # Parse JSON response from Pabbly
            pabbly_data = pabbly_response.json()
            print("Pabbly Response Data:", pabbly_data)

        except ValueError:
            print("Failed to parse JSON from Pabbly response")
            return None
    else:
        print(f"Failed to send webhook to Pabbly. Status code: {pabbly_response.status_code}, Response: {pabbly_response.text}")
        return None

except requests.exceptions.Timeout:
    print("The request to Pabbly timed out")
    return None
except requests.exceptions.RequestException as e:
    print(f"An error occurred with Pabbly request: {e}")
    return None

# Google Maps Directions API URL
google_maps_url = f"https://maps.googleapis.com/maps/api/directions/json?origin={origin}&destination={destination}&key={google_api_key}"

try:
    # Sending GET request to Google Maps Directions API
    google_maps_response = requests.get(google_maps_url, timeout=10)

    print(f"Google Maps Status code: {google_maps_response.status_code}")
    print(f"Google Maps Response content: {google_maps_response.text}")

    if google_maps_response.status_code == 200:
        try:
            # Parse JSON response from Google Maps
            google_maps_data = google_maps_response.json()
            routes = google_maps_data.get("routes", [])
            
            if routes:
                # Extracting first route's summary and steps
                route_summary = routes[0].get("summary", "No summary available")
                steps = routes[0].get("legs", [{}])[0].get("steps", [])
                
                directions = [
                    {
                        "instruction": step.get("html_instructions", "No instruction available"),
                        "distance": step.get("distance", {}).get("text", "Unknown distance"),
                        "duration": step.get("duration", {}).get("text", "Unknown duration")
                    }
                    for step in steps
                ]
                
                return {
                    "route_summary": route_summary,
                    "directions": directions
                }
            else:
                print("No routes found in Google Maps response")
                return None
            
        except ValueError:
            print("Failed to parse JSON from Google Maps response")
            return None
    else:
        print(f"Failed to fetch directions from Google Maps. Status code: {google_maps_response.status_code}, Response: {google_maps_response.text}")
        return None

except requests.exceptions.Timeout:
    print("The request to Google Maps API timed out")
    return None
except requests.exceptions.RequestException as e:
    print(f"An error occurred with Google Maps API request: {e}")
    return None

I figured it out by Webhooking data in Data Forwarder with proper JSON structure. How do you achieve the same thing in Make? For now, it looks like Pabbly is much more user-friendly.

I already refunded Boost. Space, which is a Make partner, since the support couldn’t figure out how to do the same thing Pabbly Connect did, and even Make’s support since I bought from their partner, refused to help me.

I just had a small error in my JSON, and then they fixed it, and it worked. I didn’t need to create a Pabbly or Make webhook with response action.