APIs & Integrations

Jason_Connor
Member

No updates when using the batch contact update or create endpoint

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’: ‘’},

]
},

]

0 Upvotes
5 Replies 5
robertainslie
HubSpot Employee
HubSpot Employee

No updates when using the batch contact update or create endpoint

@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.
0 Upvotes
Jason_Connor
Member

No updates when using the batch contact update or create endpoint

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.

0 Upvotes
robertainslie
HubSpot Employee
HubSpot Employee

No updates when using the batch contact update or create endpoint

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

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

No updates when using the batch contact update or create endpoint

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

0 Upvotes
Jason_Connor
Member

No updates when using the batch contact update or create endpoint

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

0 Upvotes