APIs & Integrations

Not applicable

Getting a “400 Bad Request” JAVA

Hi

I am trying to create a contact via our API. The call & info all works fine when run through postman. I have confirmed that the body is formed correctly.

{
	"properties": [{
		"property": "firstname",
		"value": "Mark"
	}, {
		"property": "email",
		"value": "demo@fake.com"
	}, {
		"property": "lastname",
		"value": "Egan"
	}]
}

At a loss as not sure, using restTemplate to send over. I have the content type set . All looks the exact same as my postman request.

0 Upvotes
2 Replies 2
romaindalichamp
Member

Getting a “400 Bad Request” JAVA

Hi, i did the exactly same question here: https://community.hubspot.com/t5/APIs-Integrations/Getting-400-Bad-Request-when-trying-to-add-a-Blog...

 

Did you find any solution ? I am very interested.

My solution is, for now, to use UniRest library ... i would naturally prefer RestTemplate.

Thank you !

Romain


0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Getting a “400 Bad Request” JAVA

Hi @official_99,

Happy to help.

That payload is correctly formed, but could you also share the code you're using to form the request? If you're using an API key, please remove it but provide your Hub ID.

Isaac Takushi

Associate Certification Manager
0 Upvotes