When any contact details change, get that details using WebHook

companies
contacts
deals

#1

Hi Team,

I have two questions below:

  1. When any contact or company details change then I need to getting that record details using WebHook in C#.Net technology.

  2. When I want to create a company it thrown a "Bad Request meaage".
    Code is below:

var client = new RestClient("https://api.hubapi.com/");

        var request = new RestRequest("companies/v2/companies?hapikey=" + hapiKey, Method.POST);
        request.AddQueryParameter("hapikey", hapiKey);
        request.RequestFormat = DataFormat.Json;

        request.AddBody(new
        {
            properties = new[] {
                new { property = "name", value = accountName},
                new { property = "domain", value = domainName},
                new { property = "description", value = accountDescription},
                new { property = "hubspot_owner_id", value = accountOwner}
            }
        });

        IRestResponse response = client.Execute(request);

Please help.


#2

Hi @surajit.ghosh,

Can you give me the raw error you're getting from HubSpot, and if possible could you log the raw request body that you're sending? That looks fine at a first glance, but I'm not familiar enough with C# to say with certainty what exactly the resulting request body will look like.