APIs & Integrations

stevehall13
Member

Opt out fields not in contact JSON data

SOLVE

Unable to find field in API

We are looking to use the API to get contact properties for opt-out, however I am not finding them in the payload. Example:
https://api.hubapi.com/contacts/v1/contact/email/steve.hall@kavokerr.com/profile?hapikey=XXXX

Looking for the following:
hs_email_optout_4849582
hs_email_optout_4849490
hs_email_optout_4849481

I do see other hs_email_optout_##### fields but they do not match the numeric value I'm looking for.

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Opt out fields not in contact JSON data

SOLVE

Thank you for the links, @stevehall13.

In the future, please always include the Hub ID you are referring to. I have no way to see this on my end. I inferred that you were working in portal 547876 because you included your kavokerr.com email in the first post.

Properties which have unknown values (unlike null values) do not appear in a contact's API data. Your test contact record has unknown values for subscriptions

  • hs_email_optout_4849582
  • hs_email_optout_4849490
  • hs_email_optout_4849481

because it was created manually and isn't currently subscribed to anything other than hs_email_optout_15589:

The other three hs_email_optout properties which appear in the response for this contact:

  • hs_email_optout_351215: "Opted out of email: KaVo Dental Blog Subscription"
  • hs_email_optout_352375: "Opted out of email: Newsletters"
  • hs_email_optout_912672: "Opted out of email: Try KaVo"

belong to inactive subscription types.

Unknown property values are excluded from JSON payloads for other properties as well. For example, your test contact has no value for the Annual revenue property, so annualrevenue is also completely absent from the JSON.

Most organically-created contacts like this one should have all of their hs_email_optout properties visible in the payload, however.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
5 Replies 5
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Opt out fields not in contact JSON data

SOLVE

Thank you for the links, @stevehall13.

In the future, please always include the Hub ID you are referring to. I have no way to see this on my end. I inferred that you were working in portal 547876 because you included your kavokerr.com email in the first post.

Properties which have unknown values (unlike null values) do not appear in a contact's API data. Your test contact record has unknown values for subscriptions

  • hs_email_optout_4849582
  • hs_email_optout_4849490
  • hs_email_optout_4849481

because it was created manually and isn't currently subscribed to anything other than hs_email_optout_15589:

The other three hs_email_optout properties which appear in the response for this contact:

  • hs_email_optout_351215: "Opted out of email: KaVo Dental Blog Subscription"
  • hs_email_optout_352375: "Opted out of email: Newsletters"
  • hs_email_optout_912672: "Opted out of email: Try KaVo"

belong to inactive subscription types.

Unknown property values are excluded from JSON payloads for other properties as well. For example, your test contact has no value for the Annual revenue property, so annualrevenue is also completely absent from the JSON.

Most organically-created contacts like this one should have all of their hs_email_optout properties visible in the payload, however.

Isaac Takushi

Associate Certification Manager
0 Upvotes
stevehall13
Member

Opt out fields not in contact JSON data

SOLVE
0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Opt out fields not in contact JSON data

SOLVE

Hi @stevehall13,

The Get email subscription types endpoint doesn't return any subscriptions matching those values for portal 547876, so we wouldn't expect them to exist on a contact record, either.

The only subscriptionId values returned are:

  • 842354
  • 411679
  • 474233
  • 787858
  • 809876
  • 770193
  • 892194
  • 5341689
  • 411678
  • 623347

Isaac Takushi

Associate Certification Manager
0 Upvotes
stevehall13
Member

Opt out fields not in contact JSON data

SOLVE

Then I'm confused. I'm looking to retrieve the following contact properties (as listed in Contacts > Property-Settings). These are all listed as HubSpot fields and not user created fields. I don't know what the numeric value at the end of the internal name represents.

Label: Opted out of email: Postal Mail
Internal name: hs_email_optout_4849582

Label: Opted out of email: Telephone
Internal name: hs_email_optout_4849490

Label: Opted out of email: Fax
Internal name: hs_email_optout_4849481

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Opt out fields not in contact JSON data

SOLVE

Hi @stevehall13,

Can you send me links to where you're seeing these properties? I searched portal 547876's contact properties and found no such properties.

The string following hs_email_optout_ is the ID of the subscription type. Per my last post, those subscriptions don't exist according to the API.

Isaac Takushi

Associate Certification Manager
0 Upvotes