Webhook Integration with Unbounce

Hi,
I am completely new to webhook integration with unbounce. I want to get lead data to our server through webhook. I made R&D and found webhook receiver code in handler(.ashx) file. When I submit unbounce form, it is working fine and data is added in leads. But webhook is showing error i.e. “integration error”. I do not want to use any third party tool to create a webhook post url. So someone please guide me to resolve this issue on an urgent basis.

Hey @nagarajan08032,

You’ve mentioned a .ashx file which leads me to believe you are using some kind of .NET backend.

You don’t need to use a 3rd party to create a webhook but you would need to modify your .ashx file to receive the webhook.
The integration error Unbounce throws up is probably because your endpoint doesn’t return back the proper response (200).

If I were you, I would look into how to write a script for your particular backend setup.

Best,
Hristian

Hi Hristian,

Thanks for responding me. yes now I understand the issue. I will paste the code which I found through R&D. Could you please go through code and guide me to resolve this issue or suggest me some samples for webhook receiver Unbounce.

using System;
using System.Web;
using System.Web.Script.Serialization;
using System.IO;
using System.Collections.Generic;
public class Getunbouncedata : IHttpHandler {

public void ProcessRequest (HttpContext context) {
 
    var jsonSerializer = new JavaScriptSerializer();

    var jsonString = string.Empty;

    context.Request.InputStream.Position = 0;
    using (var inputStream = new StreamReader(context.Request.InputStream))
    {
        jsonString = inputStream.ReadToEnd();
    }

    var data = new List<string>();
    data = jsonSerializer.Deserialize<List<string>>(jsonString);


    //Modification and Saving Data

    context.Response.Write(data);
}

public bool IsReusable {
    get {
        return false;
    }
}

}