Form contact importing problem

Highlighted

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?

Thanks
Francesco

Reply
0 Upvotes
5 Replies 5
Highlighted
HubSpot Employee

@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?

Reply
0 Upvotes
Highlighted

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

sei_un_privato_o_un_azienda_=Privato&company=&firstname=testhubspot&lastname=ctesthubspot&mobilephone=123456789&email=testhubspot%40tesths.it&city=testhubspot&message=testhubspot+testhubspot&come_ci_hai_conosciuto_=Internet&provenienza=Landing+Page&hs_context=%7b%22hutk%22%3A%22myhutk%22%2C%22ipAddress%22%3A%22217.58.150.8%22%2c%22pageUrl%22%3a%22http%3a%2f%2fwww.mysite.it%2fdefault.aspx%22%2c%22pageName%22%3a%22contattaci%22%7d

Without url encode is:

sei_un_privato_o_un_azienda_=Privato&company=&firstname=testhubspot&lastname=ctesthubspot&mobilephone=123456789&email=testhubspot@tesths.it&city=testhubspot&message=testhubspot+testhubspot&come_ci_hai_conosciuto_=Internet&provenienza=Landing+Page&hs_context={"hutk":"myhubspothutk","ipAddress":"217.58.150.8","pageUrl":"http://www.mysite.it/default.aspx","pageName":"contattaci"}

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 😕

Reply
0 Upvotes
Highlighted
HubSpot Employee

@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?

Reply
0 Upvotes
Highlighted

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.

Reply
0 Upvotes
Highlighted
HubSpot Employee

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

Reply
0 Upvotes