APIs & Integrations

RGroothuis
Participant

Using filtering in Query Param (external API/Private App)

SOLVE

I'm testing an App developend using Adalo, I can retrieve the company information from Hubspot, that is working. But I want to filter the list before the data is returned to Adalo. I want to add something like: "filter" on "type=PARTNER". Is this possible using the Query Param in the API/URL call? If not, what is the solution to achieve this? 

0 Upvotes
1 Accepted solution
himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Using filtering in Query Param (external API/Private App)

SOLVE

Hello @RGroothuis 
Company is an object type and unfortunately, it's not possible to add a filter on the property of the object through the list api.

 

Although you can use the search API which allows you to filter the results based on the search value

 

https://developers.hubspot.com/docs/api/crm/search#filter-search-results

curl https://api.hubapi.com/crm/v3/objects/companies/search \
  --request POST \
  --header "Content-Type: application/json" \
  --data '{
    "filterGroups":[
      {
        "filters":[
          {
            "propertyName": "firstname",
            "operator": "EQ",
            "value": "Alice"
          }
        ]
      }
    ]
  }'

Here you can add the property name and the value to search and based on that it will return you the companies and you can use the cursor to go through the list.

Digital Marketing & Inbound Expert In Growth Hacking Technology

View solution in original post

1 Reply 1
himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Using filtering in Query Param (external API/Private App)

SOLVE

Hello @RGroothuis 
Company is an object type and unfortunately, it's not possible to add a filter on the property of the object through the list api.

 

Although you can use the search API which allows you to filter the results based on the search value

 

https://developers.hubspot.com/docs/api/crm/search#filter-search-results

curl https://api.hubapi.com/crm/v3/objects/companies/search \
  --request POST \
  --header "Content-Type: application/json" \
  --data '{
    "filterGroups":[
      {
        "filters":[
          {
            "propertyName": "firstname",
            "operator": "EQ",
            "value": "Alice"
          }
        ]
      }
    ]
  }'

Here you can add the property name and the value to search and based on that it will return you the companies and you can use the cursor to go through the list.

Digital Marketing & Inbound Expert In Growth Hacking Technology