APIs & Integrations

Uther
Member

Custom Object Search Filters dont seem to work

Hi,

 

I am trying to filter out custom object records by the hubspot_owner_id.

First of all, it seems that the Owner property which HubSpot creates on each Custom object does not get filled when I receive the data. The 'hubspot_owner_id' just returns null.

 

The other issue is that the Search API supports filterGroups, but the filters do not seem to have an impact on the result. I tried filtering by hubspot_owner_id or anything else, but even if I filtered for nonsense, the API would just return the same record (I only created one record for testing purposes).

 

Has anyone had similar issues with custom objects and the API?

 

Best regards,

Uther Ali

0 Upvotes
5 Replies 5
Uther
Member

Custom Object Search Filters dont seem to work

Bump

0 Upvotes
Uther
Member

Custom Object Search Filters dont seem to work

I've found a workaround using the associations api, i am pulling the ids from there and then batch read from the objects batch read endpoint, which works but the fields that hubspot should manage are still null

0 Upvotes
enrico_baskey
Participant | Platinum Partner
Participant | Platinum Partner

Custom Object Search Filters dont seem to work

Hello Uther Ali, 

The Owner Id ist not set automatically if you create a record of a custom object.

You need to first set it in HubSpot. 

This search request worked for me. I created two custom objects, with two different owner, searched for one and only got one result.

 

POST https://api.hubapi.com/crm/v3/objects/{{ObjectType}}/search
Authorization: Bearer {{apiToken}}
Content-Type: application/json

{
  "properties": ["hubspot_owner_id"],
  "filterGroups":[
    {
      "filters":[
        {
          "propertyName": "hubspot_owner_id",
          "operator": "EQ",
          "value": "101010101"
        }
      ]
    }
  ]
}

 

 

The `hs_created_by_user_id` gets set automatically on object creation, if you can use this instead.

 

Hope this helps, and if it does, please feel free to mark it as solution, so others can find it more easily 🙂 

 

 

0 Upvotes
Uther
Member

Custom Object Search Filters dont seem to work

Also if i open the property settings it also clearly says that hubspot handles these properties and i cant modify or fill them. ( owner and created_by_user )

0 Upvotes
Uther
Member

Custom Object Search Filters dont seem to work

Hi,

 

`hs_created_by_user_id` is also null in my case

Uther_0-1677162380739.png

 

0 Upvotes