APIs & Integrations

tonyfarag
Member

Lead Source API

SOLVE

 

Need some help on getting a list of Lead Sources via an API.  We have created custom Lead Source properties and would like to access this from our web app.  I can't seem to find an API to give me just this list.  

 

Can anyone point me to the API that might help get this info if it's possible?

 

Thank you,

Tony

0 Upvotes
1 Accepted solution
Willson
Solution
HubSpot Employee
HubSpot Employee

Lead Source API

SOLVE

Hi @tonyfarag 

 

Unfortunately our APIs dont function like this. The properties are stored in HubSpot but the values associated to the property are stored against the object itself. 


This means that if you have a Contact Property and are looking for all Contacts with a specific value, you'll need to fetch All Contacts and then apply a filter query via our v3 CRM Search API. 


This would give you a request along the lines of the following:

curl https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=YOUR_HUBSPOT_API_KEY \
  --request POST \
  --header "Content-Type: application/json" \
  --data '{
    "filterGroups":[
      {
        "filters":[
          {
            "propertyName": "Custom Property",
            "operator": "EQ",
            "value": "CUSTOM_VALUE"
          }
        ]
      }
    ]
  }'

This can be seen in our documentation here: https://developers.hubspot.com/docs-beta/crm/search

 

I hope this helps!

Product Manager @ HubSpot

View solution in original post

0 Upvotes
2 Replies 2
Willson
Solution
HubSpot Employee
HubSpot Employee

Lead Source API

SOLVE

Hi @tonyfarag 

 

Unfortunately our APIs dont function like this. The properties are stored in HubSpot but the values associated to the property are stored against the object itself. 


This means that if you have a Contact Property and are looking for all Contacts with a specific value, you'll need to fetch All Contacts and then apply a filter query via our v3 CRM Search API. 


This would give you a request along the lines of the following:

curl https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=YOUR_HUBSPOT_API_KEY \
  --request POST \
  --header "Content-Type: application/json" \
  --data '{
    "filterGroups":[
      {
        "filters":[
          {
            "propertyName": "Custom Property",
            "operator": "EQ",
            "value": "CUSTOM_VALUE"
          }
        ]
      }
    ]
  }'

This can be seen in our documentation here: https://developers.hubspot.com/docs-beta/crm/search

 

I hope this helps!

Product Manager @ HubSpot
0 Upvotes
tonyfarag
Member

Lead Source API

SOLVE

@Willson  Thank you for providing that info.  That helped a lot.

 

Tony

0 Upvotes