I want to use the api to subscribe a contact to a subscription type. However, if that contact is already subscribed to that subscription type, I am getting a 400 error.
My solution would be first check the subscription status of the contact and only subscribe the contact if the contact hasn’t subscribe to that subscription. The issue here is this endpoint returns a list of subscriptions and their status for a given contact, however, when the status is “Not Specified”, the api is returning status as “Subscribed”
Hey, @ALim467 I hope you worked this out. If not, I’ll add some context here. I found a few support tickets and community posts discussing this issue.
It comes down to, do you have GDPR enabled + Legal basis for sending emails enabled? If not, you’ll get the result you’re seeing. If you chose to enable it, you’ll start getting the result you expect.
More details:
"This behaviour you’re seeing is working as designed. In general, remember that any contact in HubSpot can receive email (without GDPR enabled). Until they explicitly opt out, we keep them in a “neutral” state, which is “SUBSCRIBED””.
“In non GDPR portals, since explicit consent isn’t required, a NOT_OPTED contact can receive email, so is considered “Subscribed””.
I hope this helps explain why you are getting this unexpected status.