May 29, 2020 2:39 PM
Hi,
I'm trying to retrieve some of the Email Opted-Out fields from Hubspot into our database using the following API:
When run this API, I can see all the fields in the list return with the exception hs_email_optout_8324033.
Can someone let us know what should I do to make this field return as well?
Thanks,
Allan
Solved! Go to Solution.
Jun 3, 2020 5:06 AM
Hey @Benchmark_achen,
Upon digging further into this, I believe I would be able to shed some lights here.
The reason why you're not seeing property hs_email_optout_8324033 is likely because on the first page of the return result (first 100 contacts that you retrieved), there's no contact with this property set (not even set with a "" value).
As such, the property isn't showing up.
If you'd like to return property even if it's null, you may want to explore the option of using CRM API | Contacts:
GET crm/v3/objects/contacts?limit=10&properties=hs_email_optout_8324033%2Cbnid_%2Cemail%2Chs_content_membership_status%2Chs_email_optout%2Chs_email_optout_6236625%2Chs_email_optout_7778519%2Chs_email_optout_6236646&archived=false&hapikey=yourHapikey
This should return all properties stated on the query parameter for each contact records even if the property is null.
Let me know if this works for you 🙂
Jun 1, 2020 1:59 AM
Hey @Benchmark_achen,
Taking a look at request URL, I noticed that there's a double `&&` in the request url parameter:
&property=hs_email_optout_6236646&&count=100
if we remove one of the &, like this:
https://api.hubapi.com/contacts/v1/lists/all/contacts/all?property=bnid_&property=email&property=hs_... --> this should return property hs_email_optout_8324033.
Could you try and see if this works?
Jun 1, 2020 9:13 AM
Nope, that field still doesn't show up. Here is the updated URL:
Here is the output (I'm using the ZappySys JSON Source SSIS components to run this URL):
Jun 3, 2020 5:06 AM
Hey @Benchmark_achen,
Upon digging further into this, I believe I would be able to shed some lights here.
The reason why you're not seeing property hs_email_optout_8324033 is likely because on the first page of the return result (first 100 contacts that you retrieved), there's no contact with this property set (not even set with a "" value).
As such, the property isn't showing up.
If you'd like to return property even if it's null, you may want to explore the option of using CRM API | Contacts:
GET crm/v3/objects/contacts?limit=10&properties=hs_email_optout_8324033%2Cbnid_%2Cemail%2Chs_content_membership_status%2Chs_email_optout%2Chs_email_optout_6236625%2Chs_email_optout_7778519%2Chs_email_optout_6236646&archived=false&hapikey=yourHapikey
This should return all properties stated on the query parameter for each contact records even if the property is null.
Let me know if this works for you 🙂
Jun 3, 2020 10:00 AM
Thank you @WendyGoh !
Yes, you were right. The count was too low to get any data out of field hs_email_optout_8324033. I expanded the count to 10000 and this field finally shows up.
Thanks again!
--Allan
Jun 2, 2020 9:14 PM
Hey @Benchmark_achen,
This is interesting. I'm also seeing the same behavior.
In this case, I'll have to work together with our internal team on this and I'll keep you posted here!