<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Update email subscription status for an email address: error 405 (lack of documentation?) in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Update-email-subscription-status-for-an-email-address-error-405/m-p/226534#M5430</link>
    <description>&lt;P&gt;We are trying to update the email subscription status of users that sign up to our software (for GDPR purposes).&lt;/P&gt;
&lt;P&gt;We are adding a subscription. But our request is failing with error 405. Would you guys know why?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Endpoint: https://api.hubapi.com/email/public/v1/subscriptions/test@test.com/?hapikey=XXX&amp;amp;portalId=XXX
Body: '{"subscriptionStatuses": [{"id":0,"subscribed":true,"optState":"OPT_IN","legalBasis":"LEGITIMATE_INTEREST_PQL","legalBasisExplanation":"XXX"}],"portalSubscriptionLegalBasis":"LEGITIMATE_INTEREST_PQL","portalSubscriptionLegalBasisExplanation":"XXX"}' },
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the documentation is not clear what is expected in the id, and what is portalSubscriptionLegalBasis (!?). The link is here: &lt;A href="https://developers.hubspot.com/docs/methods/email/update_status" rel="nofollow noopener"&gt;https://developers.hubspot.com/docs/methods/email/update_status&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Would you be able to help with the error, and clarifying what are these fields?&lt;/P&gt;</description>
    <pubDate>Sat, 20 Oct 2018 11:46:47 GMT</pubDate>
    <dc:creator>raphaelarias</dc:creator>
    <dc:date>2018-10-20T11:46:47Z</dc:date>
    <item>
      <title>Update email subscription status for an email address: error 405 (lack of documentation?)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-email-subscription-status-for-an-email-address-error-405/m-p/226534#M5430</link>
      <description>&lt;P&gt;We are trying to update the email subscription status of users that sign up to our software (for GDPR purposes).&lt;/P&gt;
&lt;P&gt;We are adding a subscription. But our request is failing with error 405. Would you guys know why?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Endpoint: https://api.hubapi.com/email/public/v1/subscriptions/test@test.com/?hapikey=XXX&amp;amp;portalId=XXX
Body: '{"subscriptionStatuses": [{"id":0,"subscribed":true,"optState":"OPT_IN","legalBasis":"LEGITIMATE_INTEREST_PQL","legalBasisExplanation":"XXX"}],"portalSubscriptionLegalBasis":"LEGITIMATE_INTEREST_PQL","portalSubscriptionLegalBasisExplanation":"XXX"}' },
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the documentation is not clear what is expected in the id, and what is portalSubscriptionLegalBasis (!?). The link is here: &lt;A href="https://developers.hubspot.com/docs/methods/email/update_status" rel="nofollow noopener"&gt;https://developers.hubspot.com/docs/methods/email/update_status&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Would you be able to help with the error, and clarifying what are these fields?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 11:46:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-email-subscription-status-for-an-email-address-error-405/m-p/226534#M5430</guid>
      <dc:creator>raphaelarias</dc:creator>
      <dc:date>2018-10-20T11:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Update email subscription status for an email address: error 405 (lack of documentation?)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-email-subscription-status-for-an-email-address-error-405/m-p/226535#M5431</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/raphael_arias"&gt;@Raphael_Arias&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;Happy to help. Can you confirm which method you are using? &lt;A href="https://developers.hubspot.com/docs/methods/email/update_status"&gt;This endpoint&lt;/A&gt; requires &lt;CODE&gt;PUT&lt;/CODE&gt;, so if you're receiving a &lt;CODE&gt;405 METHOD NOT ALLOWED&lt;/CODE&gt; error, I suspect you may be using &lt;CODE&gt;POST&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;The &lt;CODE&gt;id&lt;/CODE&gt; parameter refers to the &lt;CODE&gt;subscriptionId&lt;/CODE&gt; defined in &lt;A href="https://developers.hubspot.com/docs/methods/email/email_subscriptions_overview"&gt;this article&lt;/A&gt;. You can retrieve these IDs via &lt;A href="https://developers.hubspot.com/docs/methods/email/get_subscriptions"&gt;this endpoint&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;The &lt;CODE&gt;portalSubscriptionLegalBasis&lt;/CODE&gt; parameter reflects your legal basis for communicating with the recipient under the GDPR. The five options reflect the broad categories of legal basis discussed &lt;A href="https://www.hubspot.com/data-privacy/gdpr/hubspot-product-playbook"&gt;here&lt;/A&gt;. I recommend working with your own legal counsel if you're not familiar with which options best apply in your situation.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 17:39:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-email-subscription-status-for-an-email-address-error-405/m-p/226535#M5431</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2018-10-23T17:39:55Z</dc:date>
    </item>
  </channel>
</rss>

