APIs & Integrations

raphaelarias
Contributor

Update email subscription status for an email address: error 405 (lack of documentation?)

SOLVE

We are trying to update the email subscription status of users that sign up to our software (for GDPR purposes).

We are adding a subscription. But our request is failing with error 405. Would you guys know why?

Endpoint: https://api.hubapi.com/email/public/v1/subscriptions/test@test.com/?hapikey=XXX&portalId=XXX
Body: '{"subscriptionStatuses": [{"id":0,"subscribed":true,"optState":"OPT_IN","legalBasis":"LEGITIMATE_INTEREST_PQL","legalBasisExplanation":"XXX"}],"portalSubscriptionLegalBasis":"LEGITIMATE_INTEREST_PQL","portalSubscriptionLegalBasisExplanation":"XXX"}' },

In the documentation is not clear what is expected in the id, and what is portalSubscriptionLegalBasis (!?). The link is here: https://developers.hubspot.com/docs/methods/email/update_status

Would you be able to help with the error, and clarifying what are these fields?

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Update email subscription status for an email address: error 405 (lack of documentation?)

SOLVE

Hi @Raphael_Arias,

Happy to help. Can you confirm which method you are using? This endpoint requires PUT, so if you're receiving a 405 METHOD NOT ALLOWED error, I suspect you may be using POST.

The id parameter refers to the subscriptionId defined in this article. You can retrieve these IDs via this endpoint.

The portalSubscriptionLegalBasis parameter reflects your legal basis for communicating with the recipient under the GDPR. The five options reflect the broad categories of legal basis discussed here. I recommend working with your own legal counsel if you're not familiar with which options best apply in your situation.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
1 Reply 1
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Update email subscription status for an email address: error 405 (lack of documentation?)

SOLVE

Hi @Raphael_Arias,

Happy to help. Can you confirm which method you are using? This endpoint requires PUT, so if you're receiving a 405 METHOD NOT ALLOWED error, I suspect you may be using POST.

The id parameter refers to the subscriptionId defined in this article. You can retrieve these IDs via this endpoint.

The portalSubscriptionLegalBasis parameter reflects your legal basis for communicating with the recipient under the GDPR. The five options reflect the broad categories of legal basis discussed here. I recommend working with your own legal counsel if you're not familiar with which options best apply in your situation.

Isaac Takushi

Associate Certification Manager
0 Upvotes