APIs & Integrations

gustafm
Member

Subscriptions: How to tell if an e-mail is subscribed or not?

When accessing the HubSpot API to get the current subscription status for a given e-mail address, using the URL

/communication-preferences/v3/status/email/{emailAddress}

I always get the same, whether an e-mail is subscribed or not. The difference can only be seen in the backend on the contact page below subscriptions. How can I get the correct result if an e-mail was not yet used for a subscription?

 

    [subscriptionStatuses] => Array
        (
            [0] => Array
                (
                    [id] => {redacted}
                    [name] => One to One
                    [description] => One to One emails
                    [status] => SUBSCRIBED
                    [sourceOfStatus] => SUBSCRIPTION_STATUS
                    [brandId] => 
                    [preferenceGroupName] => 
                    [legalBasis] => 
                    [legalBasisExplanation] => 
                )

 

9 Replies 9
vLakshmi
Member

Subscriptions: How to tell if an e-mail is subscribed or not?

How to see all mais id's at a time which is subscribed or not 

0 Upvotes
SIZZA
Participant

Subscriptions: How to tell if an e-mail is subscribed or not?

I'm facing the same situation.

When I create a new contact and check with the API the subscription status (using postman), with this endpoint https://api.hubapi.com/communication-preferences/v3/status/email/{email} I find that this contact is "SUBSCRIBED" to all campains

 

Any advice ?

0 Upvotes
gustafm
Member

Subscriptions: How to tell if an e-mail is subscribed or not?

If you go to Settings > Data Privacy, check if you have GDPR Tools enabled. If so, the next line “Legal Basis“ needs to be checked, too. Enabling only GDPR Tools without this check will lead to this bug (which is considered a feature by HubSpot).

gustafm
Member

Subscriptions: How to tell if an e-mail is subscribed or not?

Same via the test call on

https://developers.hubspot.com/docs/api/marketing-api/subscriptions-preferences


Section

Get subscription statuses for a contact

emailAdress invalid

 

 

HTTP 200

{
  "recipient": "invalid",
  "subscriptionStatuses": [
    {
      "id": "REDACTED",
      "name": "One to One",
      "description": "One to One emails",
      "status": "SUBSCRIBED",
      "sourceOfStatus": "SUBSCRIPTION_STATUS",
      "brandId": null,
      "preferenceGroupName": null,
      "legalBasis": null,
      "legalBasisExplanation": null
    },
 

 

 

Looks like HubSpot does not even check if the e-mail is syntactically valid (existing hostname). But it is subscribed.

PedroSaraiva
Participant

Subscriptions: How to tell if an e-mail is subscribed or not?

Same case:

Request: https://api.hubapi.com/communication-preferences/v3/status/email/blablabla

Response:

{
    "recipient": "blablabla",
    "subscriptionStatuses": [
        {
            "id": "9116...",
            "name": "Pet Cat...",
            "description": "Comunica...",
            "status": "SUBSCRIBED",
            "sourceOfStatus": "SUBSCRIPTION_STATUS",
            "brandId": null,
            "preferenceGroupName": null,
            "legalBasis": null,
            "legalBasisExplanation": null
        }
    ]
}

 

It is not possible to make a decision only by consulting this service.

I recommend check the email exists in the contact base and then using that service... If you're looking for an e-mail outside the contact base, good luck. =(

 

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Subscriptions: How to tell if an e-mail is subscribed or not?

@gustafm 

I just tested on my end (using postman) and this is the response which shows the subscription status:

{
    "recipient": "willy@wonka.com",
    "subscriptionStatuses": [
        {
            "id": "9830020",
            "name": "One to One",
            "description": "One to One emails",
            "status": "NOT_SUBSCRIBED",
            "sourceOfStatus": "SUBSCRIPTION_STATUS",
            "brandId": null,
            "preferenceGroupName": null,
            "legalBasis": null,
            "legalBasisExplanation": null
        },
        {
            "id": "9700012",
            "name": "Customer Service Communication",
            "description": "Receive feedback requests and customer service information.",
            "status": "NOT_SUBSCRIBED",
            "sourceOfStatus": "SUBSCRIPTION_STATUS",
            "brandId": null,
            "preferenceGroupName": null,
            "legalBasis": null,
            "legalBasisExplanation": null
        }
    ]
}
gustafm
Member

Subscriptions: How to tell if an e-mail is subscribed or not?

Hi Dennis,

 

that looks good with your account. Here, however, status is never NOT_SUBSCRIBED, no matter what e-mail address I use. This is an example with curl via the command line. I am pretty sure that krkrkrkrkrkrkrkr and so on with example.com as a domain is not an e-mail address in use. But even a test with e-mail invalid@invalid.test returns that this e-mail has status SUBSCRIBED. The API key is correct, it is possible to subscribe an address. It is simply that I cannot see whether someone is already subscribed or not.

 

% curl --request GET \
  --url 'https://api.hubapi.com/communication-preferences/v3/status/email/krkrkrkrkrkkrkr@example.com?hapikey=REDACTED_KEY'
{"recipient":"krkrkrkrkrkkrkr@example.com","subscriptionStatuses":[{"id":"REDACTED_ID","name":"One to One","description":"One to One emails","status":"SUBSCRIBED","sourceOfStatus":"SUBSCRIPTION_STATUS","brandId":null,"preferenceGroupName":null,"legalBasis":null,"legalBasisExplanation":null},{"id":"REDACTED_ID","name":"Newsletter EN ","description":"Newsletter EN ","status":"SUBSCRIBED","sourceOfStatus":"SUBSCRIPTION_STATUS","brandId":null,"preferenceGroupName":null,"legalBasis":null,"legalBasisExplanation":null},{"id":"REDACTED_ID","name":"Marketing Information","description":"Marketing offers and updates.","status":"SUBSCRIBED","sourceOfStatus":"SUBSCRIPTION_STATUS","brandId":null,"preferenceGroupName":null,"legalBasis":null,"legalBasisExplanation":null},{"id":"REDACTED_ID","name":"Newsletter DE","description":"Newsletter DE","status":"SUBSCRIBED","sourceOfStatus":"SUBSCRIPTION_STATUS","brandId":null,"preferenceGroupName":null,"legalBasis":null,"legalBasisExplanation":null}]}

 

 What can I do now?

Best regards
Gustaf

0 Upvotes
TZiesing
Contributor

Subscriptions: How to tell if an e-mail is subscribed or not?

Hi there - I just posted the same issue - is there any solution for this? 

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Subscriptions: How to tell if an e-mail is subscribed or not?

Hey @TZiesing I replied to your other thread. — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes