Filter by hubspot_owner_id Contacts in Mendix from hubSpot Api

0
I would like to know what would be the JSON or filter structure in the URL to be able to filter the contacts of the api: https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey={{apikey}}&property=hubspot_owner_id&property=firstname&property=lastname   {     "contacts": [         {             "addedAt": -,             "vid": 1,             "canonical-vid": 1,             "merged-vids": [],             "portal-id": -,             "is-contact": true,             "properties": {                 "firstname": {                     "value": "Maria"                 },                 "hubspot_owner_id": {                     "value": "116296172"                 },                 "lastmodifieddate": {                     "value": "1627382492698"                 },                 "lastname": {                     "value": "Johnson (Sample Contact)"                 }             },      
asked
2 answers
2

Hi Jorge!

Checking the documentation of the API, I found this: https://developers.hubspot.com/docs/api/crm/search. I think you should do a POST REST call to this Location:

https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=YOUR_HUBSPOT_API_KEY

And inside the body of the request you can put some filters:

{
    "filterGroups":[
      {
        "filters":[
          {
            "propertyName": "firstname",
            "operator": "EQ",
            "value": "Alice"
          }
        ]
      }

 

However if you want to avoid the filter via API. Mendix can do it easily. Just map all the contacts to a Mendix entity of your Domain model and retrieve what you want using a XPath constraint.

 

If you have more doubts, please let me know.

Kind regards,

Emilio

 

 

answered
1

Thank you very much for your answer emilio.

I find that request method interesting through a POST with the filter inside the body.

I have tested it and it works correctly!

answered