APIs & Integrations

flemingapptopia
Member

Batch Company Update - 400 Response

SOLVE

Hey Folks,

I am trying to use the batch company update api (/companies/v1/batch-async/update) with little success. My first attempts yielded a 200 response, so I did some digging and saw that I need to specify the content-type as json. Changed that, and now I'm getting 400 errors. Help!

HS_API_URL = "https://api.hubapi.com"
xurl = "/companies/v1/batch-async/update"
postUrl = HS_API_URL + xurl + REDACTEDAPIKEY

headers = {'content-type':'application/json'}              
r = requests.post(postUrl, headers=headers, data=tempJson)

json
[{"objectId": 115272811, "properties": [{"name": "last_sales_email_replied_date", "value": 112}]}, {"objectId": 114942341, "properties": [{"name": "last_sales_email_replied_date", "value": 142}]}, {"objectId": 114940551, "properties": [{"name": "last_sales_email_replied_date", "value": 582}]}, {"objectId": 114941356, "properties": [{"name": "last_sales_email_replied_date", "value": 544}]}, {"objectId": 115271946, "properties": [{"name": "last_sales_email_replied_date", "value": 572}]}]

0 Upvotes
1 Accepted solution
flemingapptopia
Solution
Member

Batch Company Update - 400 Response

SOLVE

Note for others:

If you are trying to overwrite a hubspot only field, it will throw a 400 error. I was being stupid and looking at the wrong field.

-Matt

View solution in original post

0 Upvotes
3 Replies 3
flemingapptopia
Solution
Member

Batch Company Update - 400 Response

SOLVE

Note for others:

If you are trying to overwrite a hubspot only field, it will throw a 400 error. I was being stupid and looking at the wrong field.

-Matt

0 Upvotes
flemingapptopia
Member

Batch Company Update - 400 Response

SOLVE

Nevermind. Solved.

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

Batch Company Update - 400 Response

SOLVE

Glad you figured it out!

0 Upvotes