Jul 25, 2019 11:01 AM
Hi,
I was able to use the Hubspot API post/create new contacts in Hubspot using data from our database. Now, I want to GET these contacts data back along with their associated contact vid. I used the following API and it doesn't seem to work:
https://api.hubapi.com/contacts/v1/lists/all/contacts/all&property=vid&property=bnid_&property=email
(note: bnid_ is a custom property)
Let me know what need to be changed on the API in order to make it work.
Thanks,
Allan
Solved! Go to Solution.
Jul 25, 2019 6:18 PM
Hi @Benchmark_achen,
When you get data back from the endpoint documented here: https://developers.hubspot.com/docs/methods/contacts/get_contacts, you should be getting the contact's vid in the response, along with the specific properties you're requesting. If you're making the request to the exact URL you wrote:
https://api.hubapi.com/contacts/v1/lists/all/contacts/all&property=vid&property=bnid_&property=email
that actually is beginning the query string incorrectly. propery=XXXX should be a query string parameter. So you actually want to be making your request to something like:
https://api.hubapi.com/contacts/v1/lists/all/contacts/all?property=bnid_&property=email
Take note that I've changed & to ? before the first query string parameter. I've also removed property=vid because that vid is not a contact property, but rather is unique to the contact record itself. If you make the request to that URL, you should get the specific properties you're requesting, along with some other information about the contact record, including the vid.
If you're still having trouble, let me know how you're making the request and I'll be happy to look again.
Leland ScanlanHubSpot Developer Support |
Oct 15, 2020 7:55 AM
Hi All,
Appologies if I am commenting in the wrong section but the parapiter for the maximum contact records you can get using this API is 100, is there a workaround to get all? if not what would be the api call for subsquient records when 'has-more' is true?
Thank you!
Will
Jul 25, 2019 6:18 PM
Hi @Benchmark_achen,
When you get data back from the endpoint documented here: https://developers.hubspot.com/docs/methods/contacts/get_contacts, you should be getting the contact's vid in the response, along with the specific properties you're requesting. If you're making the request to the exact URL you wrote:
https://api.hubapi.com/contacts/v1/lists/all/contacts/all&property=vid&property=bnid_&property=email
that actually is beginning the query string incorrectly. propery=XXXX should be a query string parameter. So you actually want to be making your request to something like:
https://api.hubapi.com/contacts/v1/lists/all/contacts/all?property=bnid_&property=email
Take note that I've changed & to ? before the first query string parameter. I've also removed property=vid because that vid is not a contact property, but rather is unique to the contact record itself. If you make the request to that URL, you should get the specific properties you're requesting, along with some other information about the contact record, including the vid.
If you're still having trouble, let me know how you're making the request and I'll be happy to look again.
Leland ScanlanHubSpot Developer Support |
Jul 25, 2019 9:53 PM
Thank you Leland! Your suggestion works! I'm learning new things everyday on this Hubspot integration project...
--Allan