APIs & Integrations

tims
Teilnehmer/-in

Form API not accepting IP values

Hey guys,

Having some trouble with the Form API adding ipAddress to contacts, and therefore the location that’s generated based on this.

I’ve removed the IP Exclusion for the test, to no avail.

When viewing the submission on the form the hutk and ipAddress are both present, with the correct formatting to match HubSpot’s, but for some reason it’s not appearing in the contact’s information - the field history lists the only change as “HubSpot Location Service” - no mention of the form API.

An example post is below (I x’d out a few characters just in case)

https://forms.hubspot.com/uploads/form/v2/18xxxxx/0f70xxx4-1116-4a92-9461-0bxxxxf63520?email=xxxxx@g...

Any help would be much appreciated.

0 Upvotes
3 Antworten
Derek_Gervais
HubSpot-Alumnus/Alumna
HubSpot-Alumnus/Alumna

Form API not accepting IP values

Hi @timsearle.

So it looks like you're including the IP address as it's own form field. The IP address needs to be included as a part of the hs_context field in order to be processed correctly. The hs_context field is a JSON object with submission meta info, like IP address and page name/URL. The doc below has some info on how exactly that field should be formatted/included.

0 Upvotes
Derek_Gervais
HubSpot-Alumnus/Alumna
HubSpot-Alumnus/Alumna

Form API not accepting IP values

Hi @timsearle,

The form submission endpoint takes a POST request with the fields (including hs_context) in the POST body, not included as query parameters. Can you give me a link to an example contact so that I can look at the raw form submission?

0 Upvotes
tims
Teilnehmer/-in

Form API not accepting IP values

Hi Derek,

I just did a test submission which can be found here: https://app.hubspot.com/contacts/1838400/contact/444103

Thanks for your help.

0 Upvotes