API POST Or PUT?

Hi!

With reference to https://developers.hubspot.com/docs/methods/deals/update_deal

The above page instruction say to use “PUT” but when using PostMan and “Put” I get the following:

405 Method Not Allowed

If I change the method to “POST” I get 200 OK with an export of data on what has been changed, but yet, I don’t see these changes within the HubSpot portal.

So not sure what I’m missing here

Hi @grantduke,

I am unable to reproduce that. When using PUT I get a 200 OK response and the deal is updated as per the documentation. If I try to do a POST I get a 405 METHOD NOT ALLOWED. Are you also encoding the body in JSON? See my postman examples below:

PUT REQUEST: 200

POST REQUEST: 405

Regards,

Jack

Hi Jack

As you can see below. I get 405 when using PUT

Hi @grantduke,

You have a typo in your request URL. You are doing the following, notice you have an extra “?” before the deal ID.

https://api.hubapi.com/deals/v1/deal/

?

1242828230?hapikey={{apikey}}

Whereas it should be:

https://api.hubapi.com/deals/v1/deal/1242828230?hapikey={{apikey}}

Notice I’ve removed the extra “?” you have before the deal ID. This will ensure the PUT works successfuly.

Regards,

Jack