No updates when using the batch contact update or create endpoint


#1

Hi,

We’re trying to switch from the individual contact updates to batch updates to bring down the number of requests that we’re sending to Hubspot each day. When we hit the batch endpoint, we are either getting a 200 or a 202 response, but we never see any updates come through.

Does anyone have any insights as to what may be happening?

We are doing a POST (with our hapikey) to the the following:
https://api.hubapi.com/contacts/v1/contact/batch/

And sending data in the format:
[
{‘vid’: ‘’,
‘properties’: [
{‘property’: ‘’, ‘value’: ‘’},

]
},

]


#2

@Jason_Connor When you say come through are you referring to in the UI?


#3

Yes, the updates do not show up on our reports.


#4

@Jason_Connor - Two common things I’ve noticed here that could be an issue:

  1. Check your content-type header. This endpoint requires content-type:application/json
  2. It looks like the example JSON is using single quotes instead of double quotes. I would recommend swapping to the proper JSON syntax that uses double quotes.

#5

Hi Robert,

Thanks for the reply. I’m using a libraries (python json, requests) to do both the JSON encoding and the content header. I’ll double check both, but haven’t had an issue with these in the past.


#6

Yea - I would explicitly set the content-type if you are not currently:
headers = {‘content-type’:‘application/json’}
r = requests.post(url,headers=headers,payload=payload)

If you are still having issues, can you leave a more full code sample (make sure to redact your HAPI key)?