<?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 Re: Hubspot form API 405 error in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Hubspot-form-API-405-error/m-p/965230#M73026</link>
    <description>&lt;P&gt;&lt;SPAN&gt;It sounds like you're encountering a "Method Not Allowed" error (405) when trying to push form data to HubSpot's API. This error typically occurs when the HTTP method used in your request is not supported by the endpoint you're trying to access. In this case, it seems like you might be using an incorrect HTTP method. The documentation you provided specifies that you should use the POST method to submit form data to HubSpot's API. Double-check your code or request to ensure that you're indeed using the POST method. Additionally, ensure that you're using the correct endpoint URL, including your portal ID and form GUID placeholders. If the issue persists, review your API credentials and permissions to ensure they have the necessary access to submit form data. Finally, consider reaching out to HubSpot's support or consulting their documentation for further assistance or troubleshooting tips tailored to your specific situation.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Apr 2024 13:19:07 GMT</pubDate>
    <dc:creator>Nagarjoon</dc:creator>
    <dc:date>2024-04-23T13:19:07Z</dc:date>
    <item>
      <title>Hubspot form API 405 error</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Hubspot-form-API-405-error/m-p/314138#M30015</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm trying to push form data to Hubspot using the API (&lt;/SPAN&gt;&lt;A href="https://developers.hubspot.com/docs/methods/forms/submit_form_v3" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://developers.hubspot.com/docs/methods/forms/submit_form_v3&lt;/A&gt;&lt;SPAN&gt;) but I'm getting a 405 error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Problem accessing /submissions/v3/integration/submit/[portalID]/[&lt;/SPAN&gt;&lt;SPAN&gt;formGUID]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Reason: Method Not Allowed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// The following is inside a click event on a button&lt;BR /&gt;&lt;BR /&gt;  var data = {
    "fields": output,
    "context": {
      "hutk": hubCookie,
      "pageUri": pageURL,
      "pageName": pageName
    },
    "legalConsentOptions": {
      "consent": {
        "consentToProcess": true,
        "text": "I agree to allow Company to store and process my personal data.",
        // "communications": [
        //   {
        //     "value": true,
        //     "subscriptionTypeId": 999,
        //     "text": "I agree to receive marketing communications from Example Company."
        //   }
        // ]
      }
    },
    'skipValidation': true,

  }

  if ($(this).is('.step1')) {
    $.ajax({
      url: 'https://api.hsforms.com/submissions/v3/integration/submit/[portalID]/[formGUID]',
      type: "POST",
      contentType: "application/json",
      dataType: "json",
      headers: {
        "accept": "application/json",
        "Access-Control-Allow-Origin":"*"
      },
      type: "POST",
      data: data,
      success: function (result) {
        console.log(result);
      },
      error: function (status, error) {
        console.log(error, status);
      }
    });
  }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate any help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm getting this error:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Invalid input JSON on line 1, column 8: Unrecognized token 'fields': was expecting 'null', 'true', 'false' or NaN" which seems like it might be to do with stringify-ing the JSON first, but my JSON is.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What I get when I console log the output of the "output" variable I'm using for the fields&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[{"name":"firstname","value":"as"},{"name":"lastname","value":"as"},{"name":"email","value":"as@a.com"}]&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 18:05:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Hubspot-form-API-405-error/m-p/314138#M30015</guid>
      <dc:creator>piersg</dc:creator>
      <dc:date>2020-01-23T18:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Hubspot form API 405 error</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Hubspot-form-API-405-error/m-p/314309#M30034</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/103660"&gt;@piersg&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking at your code, nothing major really stood out and I think your hypothesis&amp;nbsp;may be right. In this case, could you try JSON stringify the data by replacing the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data: data,
&lt;/PRE&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data: JSON.stringify(data),&lt;/PRE&gt;
&lt;P&gt;and see if this works?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 06:37:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Hubspot-form-API-405-error/m-p/314309#M30034</guid>
      <dc:creator>WendyGoh</dc:creator>
      <dc:date>2020-01-24T06:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Hubspot form API 405 error</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Hubspot-form-API-405-error/m-p/314331#M30040</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/66274"&gt;@WendyGoh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With that addition I'm now getting&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;Invalid input JSON on line 1, column 11: Cannot deserialize instance of `java.util.ArrayList` out of VALUE_STRING token"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've got valid JSON now! Just getting "The request is not valid" error message&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The invalid request was because CAPTCHA was enabled on the form&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 11:20:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Hubspot-form-API-405-error/m-p/314331#M30040</guid>
      <dc:creator>piersg</dc:creator>
      <dc:date>2020-01-24T11:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Hubspot form API 405 error</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Hubspot-form-API-405-error/m-p/315228#M30127</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/103660"&gt;@piersg&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Awesome! Glad to know all's well here!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for sharing your findings &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 01:12:42 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Hubspot-form-API-405-error/m-p/315228#M30127</guid>
      <dc:creator>WendyGoh</dc:creator>
      <dc:date>2020-01-29T01:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Hubspot form API 405 error</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Hubspot-form-API-405-error/m-p/965230#M73026</link>
      <description>&lt;P&gt;&lt;SPAN&gt;It sounds like you're encountering a "Method Not Allowed" error (405) when trying to push form data to HubSpot's API. This error typically occurs when the HTTP method used in your request is not supported by the endpoint you're trying to access. In this case, it seems like you might be using an incorrect HTTP method. The documentation you provided specifies that you should use the POST method to submit form data to HubSpot's API. Double-check your code or request to ensure that you're indeed using the POST method. Additionally, ensure that you're using the correct endpoint URL, including your portal ID and form GUID placeholders. If the issue persists, review your API credentials and permissions to ensure they have the necessary access to submit form data. Finally, consider reaching out to HubSpot's support or consulting their documentation for further assistance or troubleshooting tips tailored to your specific situation.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 13:19:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Hubspot-form-API-405-error/m-p/965230#M73026</guid>
      <dc:creator>Nagarjoon</dc:creator>
      <dc:date>2024-04-23T13:19:07Z</dc:date>
    </item>
  </channel>
</rss>

