title: How to create a custom webhook for clickfunnels in WordPress
body: <p>I need to create a custom endpoint in WordPress to work with webhooks in Clickfunnels.</p>
  <p>The Clickfunnels documentation is not clear on this. According to the clickfunnels documentation, I have to add in my endpoint:</p>
  <ul>
  <li>create a test endpoint in &lt;your-domain/funnel_webhooks/test&gt;</li>
  </ul>
  <p>And you must include the headers below.</p>
  <ul>
  <li>Content type as application / json</li>
  <li>X-Clickfunnels-Webhook-Delivery-Id as MD5 of the URL and payload.</li>
  <li>The payload (HTTP message body) shall be a JSON object with a &quot;time&quot;
  key and the current time value in UTC as follows: { &quot;time&quot;:
  &quot;YYYYY-MM-DD HH: MM: SS UTC&quot;}</li>
  </ul>
  <p>Actually this is my code, I have successfully created the endpoint, but unfortunately Clickfunnels does not recognize it. I think that the problem may be in the headers that I add...</p>
  <pre><code>add_action( 'rest_api_init', function () {
      register_rest_route( 'funnel-webhooks', '/test',
          array(
              'methods' =&gt; 'GET', 
              'callback' =&gt; 'ffalcon_funnel_webhooks'
          )
      );
  });
  function ffalcon_funnel_webhooks(){
  
      // Set the arguments based on our get parameters
      $today = gmdate('Y-m-d H:i:s e');
      $data = array();
      $data['time'] = $today;
    $Clickfunnels_Webhook_Delivery_Id = $_SERVER[&quot;HTTP_HOST&quot;] . $_SERVER[&quot;REQUEST_URI&quot;] . $today;
  
      $response = new WP_REST_Response(json_encode($data), 200);
    $response-&gt;header( 'X-Clickfunnels-Webhook-Delivery-Id', md5($Clickfunnels_Webhook_Delivery_Id) ); 
    $response-&gt;set_data(json_encode($data));
    return $response;
      
  }
  </code></pre>
  <p>This is the url of my custom endpoint: <a href="https://test.umanyx.com/wp-json/funnel-webhooks/test" rel="nofollow noreferrer">https://test.umanyx.com/wp-json/funnel-webhooks/test</a></p>
  <p>Does anyone have experience, creating custom endpoints in WordPress to work with Clickfunnels webhooks.</p>
  <p>Any idea?</p>
  <p>Thanks</p>