How do I create a webhook in clickfunnels to send information to Wishlist Member

Viewed 441

The instructions in clickfunnels as me to start by creating a test endpoint URL:

. Creating A Test Endpoint.

First, you will need to create a test endpoint at <your-domain/funnel_webhooks/test>

And it should include the headers below.

Content-Type as application/json

X-Clickfunnels-Webhook-Delivery-Id as an MD5 of the URL and Payload.

The payload (HTTP message body) will be a JSON object with a key of "time" and value of the current time in UTC as follows:

{ "time": "YYYY-MM-DD HH:MM:SS UTC" }

I went into the file manager in my hosting and added a folder for funnel_webhooks & a file called test.

I think I changed the content type to JSON And, I think I figured out how to create the JSON object within the file. I'm not sure how to do this part: X-Clickfunnels-Webhook-Delivery-Id as an MD5 of the URL and Payload.

This loom video will show where I'm at so far in the process.

https://www.loom.com/share/1c9be96014b8413a8c9ba54f56dd42a8

Any support would be greatly appreciated!

2 Answers

It's actually much more simple than you think. They just want to verify you own the domain by getting a 200 response from any file you place in the folder on your server.

  1. Create this folder structure on your server in the root and add an index.php file or index.html file like this: /funnel_webhooks/test/index.php (I wrote "hello" in this file for good measure)
  2. Go to Click Funnels. Click your Funnel. Click Settings. Scroll to bottom and click Manage Your Funnel Webhooks
  3. Create a New webhook with the URL: whateveryourdomain/funnel_webhooks/test/index.php
  4. Click Create Funnel Webhook Button If your file is in the right location then click funnels will use this to verify you own the domain.

All of your webhooks going forward will work with no problem as long as you use this domain that was verified.

let me give it a try!

What you are doing right now is just creating a JSON file that is not going to get the webhook event from the clickfunnel.

Start by creating a PHP file if your server is compatible with PHP. And in it just write this code and try it out.

<?php
    //set the headers.
    header("Content-Type: application/json;");
    header("X-Clickfunnels-Webhook-Delivery-Id : MD5 of CONTENTS HERE");
    
    
    //check if there is input data.
    if ($json = json_decode(file_get_contents("php://input"), true)) {
    
    
      //print and set the data as variable
      print_r($json);
      $data = $json;
    
    
    }else{
    
      //try getting the POST data.
      print_r($_POST);
      $data = $_POST;
    
    }
    
    
    //set the response as OK - 200
    http_response_code(200); //response code for OK.
    echo json_encode(array("status" => 'OK', "code" => 1, "payload" => $data));
    
    
    //save the data as a file to check the information that was sent by the webhook.
    $file = 'webhook_contents.txt';
    $current = file_get_contents($file);
    $current .= date("Y-m-d h:i:s").json_encode($data);
    file_put_contents($file, $current);
    
    
    
    // From here, it all depends on what you want to do with the webhook event data.
?>

this code should give you the Headers to get a JSON payload, and echo a response of said payload. At the same time it should create a file with the name "webhook_contents.txt" in which you should be able to read the webhook event payload.

Let me know if it works!

Related