Form contact importing problem



Hello, I use form api to import contact from my site into hubspot.
It works fine but sometimes the contacts are not imported and this problem persist from 3-4 month.
I tried to catch http response of my requests but all seams to be fine.
I attached you the code I’m using for importing contacts.

The dictFormValue paramether contains this values:

Dictionary<string, string> dictFormValues = new Dictionary<string, string>();
dictFormValues.Add(“sei_un_privato_o_un_azienda_”, tipoText);
dictFormValues.Add(“company”, ragioneText);
dictFormValues.Add(“firstname”, nomeText);
dictFormValues.Add(“lastname”, cognomeText);
dictFormValues.Add(“mobilephone”, telText);
dictFormValues.Add(“email”, mailText);
dictFormValues.Add(“city”, cittaText);
dictFormValues.Add(“message”, noteText);
dictFormValues.Add(“come_ci_hai_conosciuto_”, provenienzaSelect);
dictFormValues.Add(“provenienza”, “Landing Page”);

Does anyone already had this problem?



@guidifra Can you share with us the body of the network request that you are sending to HubSpot? That appears to be your sw.Write(strPostData); call

Also when it fails do you have a copy of the response from HubSpot? Do you know if its a 500 or a 400 level error?


@pmanca Thanks for the answare. Here is the body I send to hubspot api:


Without url encode is:


And when hubspot doesen't insert data I send I don't think that http response is neither 500 neither 400 because the code doesn't go into catch{} statement :\


@guidifra hai un esempio o una risposta da HubSpot di una chiamata che non è successo? :slight_smile:

Do you have an example or response from HubSpot of a call that wasn't successful then? Are you receiving a 200 level response but aren't seeing the change in HubSpot? Do you know how often it is failing for you? Do you have a link to a contact as well for it?


Unfortunately at the moment I haven't an example of a call that wasn't succesful because the reponse of every requests is http 200 so my error handling system doesn't signal it to me and I can't understand if is an error of my code or if is hubspot that don't accept my request for some reason.
I've the customer's data that has not been imported throught api but I can't post it here for privacy reasons.
Statistically speaking every 50 contacts imported succesfully 1 contact is not imported.


@guidifra Can you direct message me the customer's data then so it is private?