Hello there!
I recently discovered an inconsistency between what the Contacts UI says about the email subscriptions for my contacts vs the information returned from the API. I think this was working fine some time ago and then went broken.
Steps to reproduce:
- I create a contact via the API
- I check the contact in HubSpot UI, looking at “Communication Subscriptions”, when clicking for the details I see that for all of my subscriptions the UI says “Not Specified”.
- I use the JS SDK to get the communication preferences via the status API (example below).
- For each of my subscriptions the API response says that the user is subscribed.
Expected result:
The information exposed in the UI and via the API is consistent and I can see via the API which of the subscriptions the user is subscribed to.
Pain point: Effectively I’m not able to programatically establish the actual subscription status.
Snippet: Reproduction code
const client = new HubspotClient({ accessToken: ACCESS_TOKEN,});(async function reproduce() { const response = await client.communicationPreferences.statusApi.getEmailStatus(EMAIL); response.subscriptionStatuses.forEach((status) => console.log( "- %s (%s from %s)", status.name, status.status, status.sourceOfStatus, ), );})().catch(console.error);
- EAP Development Updates (SUBSCRIBED from SUBSCRIPTION_STATUS)
- Marketing (SUBSCRIBED from SUBSCRIPTION_STATUS)
- Customer Service Communication (SUBSCRIBED from SUBSCRIPTION_STATUS)
- EAP Product Launches and Updates (SUBSCRIBED from SUBSCRIPTION_STATUS)
- EAP Product Research and Sruveys (SUBSCRIBED from SUBSCRIPTION_STATUS)
- Product Updates (SUBSCRIBED from SUBSCRIPTION_STATUS)