APIs & Integrations

Dominic_Newland
Member

Unable to create new deals using POST /deals/v1/deal/

Hi, I’ve been trying to create new deals through the API however none are appearing in the HubSpot portal. I’ve checked that the API key, pipeline value, deal stage value are all correct. The JSON I am attaching appears to adhere to the correct format as well.

The status code response: 200
The response header I’m getting:
{‘Date’: ‘Wed, 24 Aug 2016 07:42:22 GMT’, ‘Content-Length’: ‘0’, ‘Connection’: ‘keep-alive’, ‘Access-Control-Allow-Credentials’: ‘false’})

I am able to get the current deals from HubSpot just fine, its just the creating deals that is a problem. Does anyone have a suggestion as to what might be causing the problem?

0 Upvotes
2 Replies 2
Dominic_Newland
Member

Unable to create new deals using POST /deals/v1/deal/

Hi, thanks for the help apologies for the late reply!

Turns out I had forgotten to specify the content type in the header as JSON, all fixed now.

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Unable to create new deals using POST /deals/v1/deal/

Hi @Dominic_Newlands

If you’re getting a 200 response, that should indicate that the deal is being created, but it’s possible that the view you’re using doesn’t show those new deals (there are more details on setting up views here.

Are you logging the body of the response? It should have the deal ID of the newly created deal, which you could use to get the deal back from the API.

0 Upvotes