APIs & Integrations

michaelbarley
Contributor

CRM Search API - Not Returning The Correct Number Of Results

SOLVE

I have made a POST request to https://api.hubapi.com/crm/v3/objects/deals/search?hapikey=YOUR_HUBSPOT_API_KEY with the following body params:

 

"propertyName": "dealstage",
"operator": "EQ",
"value": "closedwon"

 

The response contained only 5 deals. When I check my HubSpot account i have 410? 

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

CRM Search API - Not Returning The Correct Number Of Results

SOLVE

Hey @michaelbarley,

 

Thanks for sharing that!

 

Digging into this, I'm able to confirm that this is because the internal value for the deal stage label - 'Closed won' is set as 'contractsent'. If you use the following post body:

 

{
    "filterGroups":[
      {
        "filters":[
          {
"propertyName": "dealstage",
"operator": "EQ",
"value": "contractsent"
          }
        ]
      }
    ]
  }

The result would return 411 closed won deals. 

 

Currently the internal value 'closedwon' is pointing to deal stage label - 'Closed lost' and since the portal has 5 deals with a deal stage of 'Closed Lost', the return results was 5. 

 

You can check your deals pipeline internal id by going to Settings > Expand 'Sales' > Click 'Deals' > Hover over a certain deal stage > Click the '</>' icon.

 

Hope this helps to shed some lights!

View solution in original post

4 Replies 4
WendyGoh
HubSpot Employee
HubSpot Employee

CRM Search API - Not Returning The Correct Number Of Results

SOLVE

Hey @michaelbarley,

 

That's strange. Would you mind sharing with me your HubSpot portal ID in question? 

0 Upvotes
michaelbarley
Contributor

CRM Search API - Not Returning The Correct Number Of Results

SOLVE

Hi @WendyGoh 

Sure it's: 4593466

0 Upvotes
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

CRM Search API - Not Returning The Correct Number Of Results

SOLVE

Hey @michaelbarley,

 

Thanks for sharing that!

 

Digging into this, I'm able to confirm that this is because the internal value for the deal stage label - 'Closed won' is set as 'contractsent'. If you use the following post body:

 

{
    "filterGroups":[
      {
        "filters":[
          {
"propertyName": "dealstage",
"operator": "EQ",
"value": "contractsent"
          }
        ]
      }
    ]
  }

The result would return 411 closed won deals. 

 

Currently the internal value 'closedwon' is pointing to deal stage label - 'Closed lost' and since the portal has 5 deals with a deal stage of 'Closed Lost', the return results was 5. 

 

You can check your deals pipeline internal id by going to Settings > Expand 'Sales' > Click 'Deals' > Hover over a certain deal stage > Click the '</>' icon.

 

Hope this helps to shed some lights!

michaelbarley
Contributor

CRM Search API - Not Returning The Correct Number Of Results

SOLVE

Hey @WendyGoh ,

 

Thank you so much! I was very confused haha 😃

 

 

0 Upvotes