Since the api for search on custom property doesnt exist i have to find a workaround. Im thinking of retrieving all contacts and then looping through each contact - extracting that property and then checking it against the search criteria
The problem im having is what API do i use to get all contacts? the current one limits to 100 results returned which doesnt help me.
ok next problem - this isnt going to work. To do multiple requests going through each page is not fast enough. We having multiple queries a day and its not going to work in having users wait for a response. it takes 5 minutes to go through 64 pages
Are you sure there isnt another way? is there no way this development requirement could be bumped up the dev queue?
Hi @carolynebrownlee, do you have an example of the code you've written that paginates through your contacts? My code on github I shared earlier will paginate through about 300 contacts in batches of 10 in about 5 seconds. If I bump up the limit to 100 per request, it gets returned back to me in under 2 seconds. 5 minutes seems incredibly long. How many properties are you requesting, and how many contacts are you paginating through? You should be able to get up to 100 at a time
Pagination is a pretty common design pattern for APIs such as the contacts api and we do not have plans to alter it at the moment.
Hi @carolynebrownlee, Agreed this endpoint is a bit complex. The endpoint returns a few fields by default (lastmodifieddatefirstname and lastname). When you specify a property in the URL, you will get back that field on a contact if that contact has a value for that field.
Hi @carolynebrownlee! What is your end goal when searching for a specific custom property? If you are curious to see just the properties, you should be able to use this endpoint: https://developers.hubspot.com/docs/methods/contacts/v2/get_contacts_properties. If you're looking for the actual values on each contact, then the get all contacts endpoint is your best bet. You'll need to paginate through all of your contacts 100 at a time by using the has-more and vid-offset properties returned back to you.
Thanks so much for your response. I will accomodate this work around.
However it would really be helpful if we could do custom searches such as "&CustomPropertyName=TESTValue"
even when i add the &vidOffset={value returned in previous call where has_more was true) doesnt appear to be working either because the vidOffset returned is the same with has_more = true.