Deal Endpoints Stopped Working Nov. 20


#1

Did anything happen on November 20? I'm using this endpoint to create a deal: https://api.hubapi.com/deals/v1/deal?hapikey=&portalId=

And on Nov. 20th, it looks like it stopped creating deals. I'm not getting an error message. I didn't change my code (it's PHP/cURL). Did something change on that date?


#3

hi @Chadr, to my knowledge, the deals endpoint did not change since Nov. 20th. Can you reply with the following:

  1. The HubID of the Account you're trying to create a deal in.
  2. The full request URL including the method (exclude your api key) --- in your example, you shouldn't need your portalID in the URL.
  3. An example of the full payload you're sending to HubSpot.

Thank you!


#4

Sure. Here's what I've got:

  1. 152131
  2. https://api.hubapi.com/deals/v1/deal?hapikey=
  3. {"portalId":"152131","associations":{"associatedVids":32395473},"properties":[{"value":"2018 - - Enterprise","name":"dealname"},{"value":"inquiry_received","name":"dealstage"},{"value":"17","name":"hubspot_owner_id"},{"value":1546554503778,"name":"closedate"}]}

Just in looking at that and the documentation, it looks like that portalId might be the issue? I don't see that in the JSON of the documentation. It's been there for at least a year, though, and worked until Nov 20.


#5

Nope, that wasn't it. The only other thing I can think is it's the hubspot_owner_id. That seems to be a contact owner, and this is a deal. And I believe that has changed recently?


#6

One other piece of info: When I take this data (the request URL and the payload) and paste into Postman, it works fine.


#7

Hey @Chadr, are you in a filtered view in HubSpot? I can see 4 instances of a deal with the same name as above: http://prntscr.com/lripaj

If the calls to the endpoint works in Postman, then it should work with PHP/cURL. It's likely something wrong with the implementation, though I don't know of a reason it would stop working suddenly. Perhaps it's a connection issue. I was able to make a POST with the json above to a different hubspot owner ID in my own portal and was successful. Deal owners internal IDs can be found here: https://app.hubspot.com/property-settings/152131/deal/hubspot_owner_id


#8

Those are all different deals (long story short, I'm making a call to get the company name that is also stopped working. But wanted to fix this first because I'm guessing they're related).

Here's the other oddity - I'm using other API endpoints on the same server that work. It seems to only be the ones that are deal-related that don't.


#9

Hi @Chadr, I was able to get the deal to go through in Postman and another REST client. Here's my JSON body:

request URL: https://api.hubapi.com/deals/v1/deal?hapikey=xxxxxxxxxx

{
"portalId" : "3430672",
"associations" : {
  "associatedVids" : [128401]
},
"properties" : [
  {
    "value" : "2018 - - Enterprise",
    "name" : "dealname"},
  {
    "value" : "106246",
    "name" : "dealstage"},
  {
    "value" : "27029667",
    "name" : "hubspot_owner_id"},
  {
    "value" : "acb3ff80-402a-433b-8c58-d85696cfa945",
    "name" : "pipeline"
  }]
} 

I get a 200 response back from the request. I confirmed with my team the endpoint did not change recently. Do you have your Content-Type header set to application/json? What does your PHP/cURL code look like?


#10

So the cURL error I'm getting is "Failed to connect to api.hubapi.com port 443: Connection refused"

This is starting to make sense. The timing is the same as when we had a new SSL certificate installed on this server. The same thing happened when I turned on SSL in HubSpot a couple months ago. That resolved itself in a few days, though. This hasn't.

It does seem to be affecting other API integrations. Any ideas on how to fix?

Thanks!

Chad


#11

Hi @Chadr, unfortunately there isn't much more I can do to help troubleshoot your issue as this is a cert issue on your side and the endpoint isn't malfunctioning. I was able to connect to api.hubapi.com on port 443 using telnet on my own machine:

I've seen this tool used to diagnose issues in the past: https://www.ssllabs.com/ssltest/analyze.html but don't know enough about SSL certifications to know if this is something that might help you out here.


#12

Yeah, understood. Hopefully it resolves itself.

Do you have any logs that would give me any more information about why you're refusing connection?