I’m trying to store user IPs with the Form API from server side. I’ve been able to do it, sending hs_context with ipAddress attribute, and contact gets updated… but only if ipAddress belongs to my server network. I’d like to send user IP, which I know, but as soon as I use his IP, the submission won’t change user IP (even though form submission is registered).
As contact ipaddress is read-only, I assume that hs_context.ipAddress should allow random IPs to be assigned to users.
I’ve sent a couple of private messages. The exact curl request works once and stops working soon. It makes testing impossible, I can’t understand what’s going on here.
I can’t understand what’s going on here. I’ve resumed this task today. After reading your comment I run the curl command that didn’t work previously, and it did work (10/13/2016 3:04 PM). Since then I’ve been struggling to replicate the exact encoding from Ruby without success. Just before giving up, I retried the exact command that worked today and it didn’t work. Could we move this discussion to private Hubspot support so I can give you the exact data for you to check it, please?
PS: in this context, “works” means “form submission was received and contact IP was updated”, and “won’t work” means “although form submission was received, contact IP was not updated”.
The ipAddress in hs_context should accept any IP address, and in fact we wouldn’t have a way to limit it to specific domains for a portal.
Do you have an example of the POST data you’re using? If there’s a problem with the ipAddress in the submission data, we grab the IP of the system making the request, so if you’re always seeing your server IP then it’s likely that there’s a formatting issue with the data.
Sure. I’ve reproduced the problem with plain cURL. These next submissions are registered as form submissions, but only the first one actually changes the form. I’ve slightly changed the first, working IP, the form and the repo ids, but I’ve kept the IP that doesn’t work:
curl -X POST -d "email=juanignaciosl10@gmail.com&hs_context={\"ipAddress\":\"162.242.9.10\"}" https://forms.hubspot.com/uploads/form/v2/474275/e6714ea6-5a62-4370-8e3d-ed96ea8ff07c
curl -X POST -d "email=juanignaciosl10@gmail.com&hs_context={\"ipAddress\":\"2.137.212.94\"}" https://forms.hubspot.com/uploads/form/v2/474275/e6714ea6-5a62-4370-8e3d-ed96ea8ff07c
If you need the actual requests please write to me.