APIs & Integrations

AdKerremans
Participant

Not getting all the wanted fields from contacts

SOLVE

Hi,

 

I am using the postman code below the retrieve all my contacts with (all) wanted fields, but I don't get them all.

How do I get ALL fields from contacts

 

{
    "filterGroups": [
        {
            "filters": [
                {
                    "value""0",
                    "propertyName""lastmodifieddate",
                    "operator""GTE"
                }
            ]
        }
    ],
    "properties": [
        "createdate",
        "email",
        "firstname",
        "hs_object_id",
        "lastmodifieddate",
        "lastname",
        "company",
        "contactowner",
        "customer_code_sap",
        "website",
        "phone",
        "companyname"
    ],
    "limit""100"
}
 
I get (partial answer)
{
    "total"22,
    "results": [
        {
            "id""1",
            "properties": {
                "company""HubSpot",
                "createdate""2021-05-11T07:02:08.438Z",
                "customer_code_sap"null,
                "email""emailmaria@hubspot.com",
                "firstname""Maria",
                "hs_object_id""1",
                "lastmodifieddate""2021-08-04T09:10:06.850Z",
                "lastname""Johnson (Sample Contact)",
                "phone"null,
                "website""http://www.HubSpot.com"
            },
            "createdAt""2021-05-11T07:02:08.438Z",
            "updatedAt""2021-08-04T09:10:06.850Z",
            "archived"false
        },
        {
            "id""51",
            "properties": {
                "company""HubSpot",
                "createdate""2021-05-11T07:02:08.798Z",
                "customer_code_sap"null,
                "email""bh@hubspot.com",
                "firstname""Brian",
                "hs_object_id""51",
                "lastmodifieddate""2021-08-09T04:19:36.811Z",
                "lastname""Halligan (Sample Contact)",
                "phone"null,
                "website""http://www.HubSpot.com"
            },
            "createdAt""2021-05-11T07:02:08.798Z",
            "updatedAt""2021-08-09T04:19:36.811Z",
            "archived"false
        },
 ......
 
Regard s
Ad
 
 
0 Upvotes
1 Accepted solution
KyleParker
Solution
Contributor

Not getting all the wanted fields from contacts

SOLVE

@AdKerremans  While there may be a better way to tackle this request, we have a process that first retrieves the full list of properties from HubSpot (GET /crm/v3/properties/{objectType}) and saves those to a database table. We then aggregate all of the rows into a single comma-separated string and call the Contacts API endpoint (search, get specific contact, etc) and concatenate that comma separated list of properties in the request body. This pulls back all contacts that meet our criteria along with all of the current properties in HubSpot. 

 

From there we save the results to a file and parse out specific properties to load to our database tables.

 

Hopefully this helps.

View solution in original post

0 Upvotes
4 Replies 4
AdKerremans
Participant

Not getting all the wanted fields from contacts

SOLVE

Hi @KyleParker ,

 

Thanks, This is what I was looking for

0 Upvotes
webdew
Guide | Diamond Partner
Guide | Diamond Partner

Not getting all the wanted fields from contacts

SOLVE

Hi @AdKerremans ,

Please make sure, your property key should be correct then it will be shown required list.

Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

0 Upvotes
AdKerremans
Participant

Not getting all the wanted fields from contacts

SOLVE

Hi @webdew ,

 

I just want ALL the properties, how can I do that?

 

Thanks and Regards

0 Upvotes
KyleParker
Solution
Contributor

Not getting all the wanted fields from contacts

SOLVE

@AdKerremans  While there may be a better way to tackle this request, we have a process that first retrieves the full list of properties from HubSpot (GET /crm/v3/properties/{objectType}) and saves those to a database table. We then aggregate all of the rows into a single comma-separated string and call the Contacts API endpoint (search, get specific contact, etc) and concatenate that comma separated list of properties in the request body. This pulls back all contacts that meet our criteria along with all of the current properties in HubSpot. 

 

From there we save the results to a file and parse out specific properties to load to our database tables.

 

Hopefully this helps.

0 Upvotes