APIs & Integrations

joeinsurancetho
Member

Can't populate business/industry field on list api

SOLVE

Hi, I am currently populating name and email by using the hubspot api. I would also like to update the business industry field. I have added the name "business_industry" to my API call, is there another name or method I should use to populate this field when adding to a list? I have attempted to update a list with this field but it does not add the entry.

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Can't populate business/industry field on list api

SOLVE

@joeinsurancethought, I appreciate your patience while I was out of office over the Thanksgiving holiday.

In HubSpot, lists are simply collections of contact records. Lists do not have their own properties; rather, they make it easier to view and act on the property values of the contacts they contain. If you're looking at a list and "see" a field for the business_industry property, what you're actually looking at is just a column label. The values in this column reflect each contact's value for that property. You cannot add column labels to lists via any API — each user must add them via this method.

While a column for a property like business_industry may not appear the first time a user looks at a list, it doesn't affect the list's functionality. The list still contains the contacts which were either manually (static list) or automatically (active list) added and all of the contacts will either have a business_industry property value or they won't. Any user can surface the values contacts have by clicking Actions > Edit columns and checking the box for the business_industry property.

Now, if you're asking how to get the business_industry property values onto contact records so that you can then view them in a list, you would use this Contacts API endpoint.

Again, this would "populate" the business_industry value for a contact, but it might not appear as a list column unless you go through these steps.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
8 Replies 8
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Can't populate business/industry field on list api

SOLVE

@joeinsurancethought, I appreciate your patience while I was out of office over the Thanksgiving holiday.

In HubSpot, lists are simply collections of contact records. Lists do not have their own properties; rather, they make it easier to view and act on the property values of the contacts they contain. If you're looking at a list and "see" a field for the business_industry property, what you're actually looking at is just a column label. The values in this column reflect each contact's value for that property. You cannot add column labels to lists via any API — each user must add them via this method.

While a column for a property like business_industry may not appear the first time a user looks at a list, it doesn't affect the list's functionality. The list still contains the contacts which were either manually (static list) or automatically (active list) added and all of the contacts will either have a business_industry property value or they won't. Any user can surface the values contacts have by clicking Actions > Edit columns and checking the box for the business_industry property.

Now, if you're asking how to get the business_industry property values onto contact records so that you can then view them in a list, you would use this Contacts API endpoint.

Again, this would "populate" the business_industry value for a contact, but it might not appear as a list column unless you go through these steps.

Isaac Takushi

Associate Certification Manager
0 Upvotes
joeinsurancetho
Member

Can't populate business/industry field on list api

SOLVE

hi @Isaac_Takushi, I haven't heard back from you. Is there any update or can you transfer this to somone else?

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Can't populate business/industry field on list api

SOLVE

Hi @joeinsurancethought,

I'm still uncertain of your goal. To restate my question from yesterday, are you trying to set the contacts' business_industry property values or modify a lists filters or visible columns?

If you are calling https://api.hubapi.com/contacts/v1/lists/{listid}/add, then you must be trying to add a contact to a static list. This has nothing to do with their business_industry property value, however.

Can you clarify?

Isaac Takushi

Associate Certification Manager
0 Upvotes
joeinsurancetho
Member

Can't populate business/industry field on list api

SOLVE

Hi @Isaac_Takushi, my goal is to have the business_industry field populated by whatever means it takes in hubspot. I don't know my way around the hubpsot so forgive me if I don't know the exact route to do that.

AFAIK api_hubapi_com/contacts/v1/lists/{listid}/add adds a contact to a static list. I do see the field business_industry in the list with id 415 so I'm not sure why you say it has nothing to do with it.

I first add the contact to the contacts in general with this:
api_hubapi_com/contacts/v1/contact/

Is this the correct sequence?

How can I populate the business_industry field?

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Can't populate business/industry field on list api

SOLVE

Hi @joeinsurancethought,

That endpoint only adds contacts which have already been created to static lists. As such, the payload should look something like:

{
  "vids": [
    123456
  ],
  "emails": [
    "j3465894@b.com"
  ]
}

The payload you're sending looks like what you would send to this Contacts API endpoint to create a contact. Once you create the contact, you can use either the vid or email value to add them to a list.

Isaac Takushi

Associate Certification Manager
0 Upvotes
joeinsurancetho
Member

Can't populate business/industry field on list api

SOLVE

I'm actually doing 2 passes. I first add to hubpsot and then I add to a specific list like this:

//Initial add to hubspot contacts
url = f'https://api.hubapi.com/contacts/v1/contact/?hapikey={hapikey}'
r = requests.post(url, data=json.dumps(tmp),timeout=timeout)

//then I add to a specific list
url = f'https://api.hubapi.com/contacts/v1/lists/{listid}/add?hapikey={hapikey}'
tmp = json.loads('''{"vids": }''')
tmp['vids'] = vids
headers = {'Content-type': 'application/json'}
r = requests.post(url, data=json.dumps(tmp),headers=headers,timeout=timeout)

Given the payload above, is there anything that would stop the business_industry from being populated?

0 Upvotes
joeinsurancetho
Member

Can't populate business/industry field on list api

SOLVE

Hi Isaac, I am doing the following:

url = f'https://api.hubapi.com/contacts/v1/lists/{listid}/add?hapikey={hapikey}'
tmp = json.loads('''{"vids": }''')
tmp['vids'] = vids
headers = {'Content-type': 'application/json'}
r = requests.post(url, data=json.dumps(tmp),headers=headers,timeout=timeout)

Here is my payload:

{'properties': [{'property': 'email', 'value': 'j3465894@b.com'}, {'property': 'firstname', 'value': 'Jo'}, {'property': 'lastname', 'value': 'e'}, {'property': 'company', 'value': 'test_co'}, {'property': 'phone', 'value': '1234567899'}, {'property': 'job_title', 'value': 'Chief Technology Officer'}, {'property': 'business_industry', 'value': 'startup'}]}

I get the following with my 200 response:
<CIMultiDictProxy('Date': 'Thu, 15 Nov 2018 23:17:23 GMT', 'Content-Type': 'application/json;charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'X-Trace': '2B3473891F1A74FF9406F6FDBE475B6BB4DB8AB737000000000000000000', 'X-HubSpot-RateLimit-Daily': '40000', 'X-HubSpot-RateLimit-Daily-Remaining': '39991', 'X-HubSpot-RateLimit-Secondly': '10', 'X-HubSpot-RateLimit-Secondly-Remaining': '8', 'Vary': 'Accept-Encoding', 'Vary': 'Accept-Encoding', 'Content-Encoding': 'gzip', 'Access-Control-Allow-Credentials': 'false', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains; preload', 'Expect-CT': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'Server': 'cloudflare', 'CF-RAY': '472082453a2-LAX')>

Do you see any problems?

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Can't populate business/industry field on list api

SOLVE

Welcome, @joeinsurancethought,

To clarify, are you trying to update the business_industry property values of contacts with a Contacts API endpoint like this or modify a contact list's filters using a Contact Lists API endpoint like this?

Either way, could you share the exact request URL you are using, the payload you are sending, and the response code and message you receive? (Please remove any authenticating information like API keys.)

Isaac Takushi

Associate Certification Manager
0 Upvotes