APIs & Integrations

SakshiChauhan
Participant

HubSpot Contacts Batch Search API not returning all the properties in the results.

SOLVE

Hi Team,

I have created one contact with first name, email, address, and date_of_birth by the create API in the postman and then I searched the same id which I have created earlier in HubSpot search API then I am only seeing its first name, email, and created-date rest all fields missing like address and date_of_birth.

So it is the expected behavior or Should I need to add more things to get the other properties?
Request:

{
    "filterGroups": [
        {
            "filters": [
                {
                    "operator": "EQ",
                    "propertyName": "id",
                    "value": "3451"
                }
            ]
        }
    ]
}

Response:

{
    "total": 1,
    "results": [
        {
            "id": "3451",
            "properties": {
                "createdate": "2020-09-02T12:06:45.263Z",
                "email": "sakshi.chauhan+hubspot@jitterbit.com",
                "firstname": "Sakshi",
                "hs_object_id": "3451",
                "lastmodifieddate": "2020-09-02T12:12:27.407Z",
                "lastname": null
            },
            "createdAt": "2020-09-02T12:06:45.263Z",
            "updatedAt": "2020-09-02T12:12:27.407Z",
            "archived": false
        }
    ]
}

 

0 Upvotes
1 Accepted solution
doneill
Solution
HubSpot Employee
HubSpot Employee

HubSpot Contacts Batch Search API not returning all the properties in the results.

SOLVE

Hey @SakshiChauhan!

 

This is the expected behavior. As you can see here on the CRM Search documentation each object has a set of properties that are returned by default. For contacts these properties are firstnamelastnameemail.

 

If you would like to return a specific contact and specific properties for that contact I would suggest using the Contacts API for this and specifically the Read Contact Endpoint. For example, your request would look like this:

Method: GET
Request URL: https://api.hubapi.com/crm/v3/objects/contacts/3451?properties=firstname,lastname,email,address,date...

 

This will return all of the above properties you were looking for on this contact.

 

More details on how to use this endpoint can be found in the Contacts API documentation here.

View solution in original post

0 Upvotes
1 Reply 1
doneill
Solution
HubSpot Employee
HubSpot Employee

HubSpot Contacts Batch Search API not returning all the properties in the results.

SOLVE

Hey @SakshiChauhan!

 

This is the expected behavior. As you can see here on the CRM Search documentation each object has a set of properties that are returned by default. For contacts these properties are firstnamelastnameemail.

 

If you would like to return a specific contact and specific properties for that contact I would suggest using the Contacts API for this and specifically the Read Contact Endpoint. For example, your request would look like this:

Method: GET
Request URL: https://api.hubapi.com/crm/v3/objects/contacts/3451?properties=firstname,lastname,email,address,date...

 

This will return all of the above properties you were looking for on this contact.

 

More details on how to use this endpoint can be found in the Contacts API documentation here.

0 Upvotes