400 Bad request when creating batch users

contacts

#1

Hello everyone!

I have an issue when creating batch contacts - I keep getting an error 400 bad request.
My JSON is valid (as confirmed by various online tools), I have triple checked my custom properties, they all exist and are correct, but I keep getting a bad request error.

All emails are valid (since my company uses Mailgun email validation), and as far as I know, there are no special characters or anything like that in names or values.

Could this happen if for example a user already exists in my HubSpot Contacts, or will the batch create/update just update the existing contacts?

Also I have tested this on smaller batches of like 10-15 users, when I was testing and it worked fine…

Any help would be greatly appreciated!

Vedran


#2

@vkopanja I would double check your JSON against our docs here

Just because it is valid JSON doesn’t mean you have formatted all of the information in the way our servers are expecting it.


#3

@pmanca It’s a 10 thousand line JSON when I format it, so that’s not really an option :sweat:.

But as I said, when I was testing I had about 10-15 users sent at a time - it worked flawlessly, so it can’t be the format of the JSON I think.

Is there anything you can see server side for the request or anything like that, any hints etc?

Thanks,
Vedran

edit: after trying to send it via cURL I get this error:

{
	"status": "error",
	"message": "Json node is missing child property",
	"correlationId": "270d5623-a8b2-4c05-8c9a-d9de763ada2d",
	"requestId": "b7f5d220ee3a94ed0df8151d8aa45c07"
}

Can this help you help me? :grinning:


#4

@vkopanja You must have a bad JSON object in there. I think you will need to figure out where the error is occurring in the JSON. If that isn’t an option then I’m not sure how you can solve your JSON issue.


#5

@vkopanja are you able to log the body of the response when you get a 400 error? There should be a more specific message in there about what we aren’t liking about the request.


#6

@zwolfson Yup, I tried over cURL with the same request body, and this is the response I get, not quite sure what’s missing:

{
	"status": "error",
	"message": "Json node is missing child property",
	"correlationId": "270d5623-a8b2-4c05-8c9a-d9de763ada2d",
	"requestId": "b7f5d220ee3a94ed0df8151d8aa45c07"
}

Could this happen if one of the fields is null/empty? Like for example, if first/lastname fields are empty?

Thanks,
Vedran


#7

Nevermind guys, I went through the JSON over the weekend and tried again with cURL (and also, now I’m getting a better error message), some emails have .con instead of .com in them, gotta love users :sweat_smile:!

Thanks for helping out guys!

Cheers,
Vedran