<?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: Can't send form data to 3rd-party API in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/958865#M72694</link>
    <description>&lt;P&gt;Ah. I do have the 'always create a record' feature turned on right now, and testing in an incognito browser repeatedly does create new records.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your suggestions and input have been invaluable. Thank you very much!&lt;/P&gt;</description>
    <pubDate>Thu, 11 Apr 2024 18:45:49 GMT</pubDate>
    <dc:creator>SRalston05</dc:creator>
    <dc:date>2024-04-11T18:45:49Z</dc:date>
    <item>
      <title>Can't send form data to 3rd-party API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/954344#M72488</link>
      <description>&lt;P&gt;I'm a web developer, but not a HubSpot developer. I'm working on javascript to send a HubSpot form's submitted data to a 3rd-party API via an ajax call. I'm providing the API key in the header of the request and sending a valid JSON object in the body. I always get the CORS "access-control-allow-origin" error when I do that. Using the exact same structure in Postman works fine. And I've successfully done this same thing, sending to the same API, for other customers where I made the request from PHP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to get past this problem using jquery? If not, any suggestions for other ways I&amp;nbsp; might go about this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 23:00:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/954344#M72488</guid>
      <dc:creator>SRalston05</dc:creator>
      <dc:date>2024-04-03T23:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can't send form data to 3rd-party API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/954527#M72497</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/501715"&gt;@SRalston05&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please insert the following key in your request JSON:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;CORS: false&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this will help you out. Please mark it as&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Solution Accepted and upvote&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;to help another Community member.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 08:19:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/954527#M72497</guid>
      <dc:creator>GRajput</dc:creator>
      <dc:date>2024-04-04T08:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can't send form data to 3rd-party API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/954949#M72511</link>
      <description>&lt;P&gt;Some research makes me think if it was going to be anything it would be crossDomain:true.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regardless, the call still fails, I'm afraid.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 18:59:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/954949#M72511</guid>
      <dc:creator>SRalston05</dc:creator>
      <dc:date>2024-04-04T18:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can't send form data to 3rd-party API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/955706#M72549</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/501715"&gt;@SRalston05&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;When you are using Postman or PHP, you are making a serverside API call, so CORS is not an issue there.&lt;/P&gt;
&lt;P&gt;However, when making an API call with JavaScript directly from the website (probably using the HubSpot form events), CORS is something that has to be managed.&lt;BR /&gt;If you have access to the code of the 3rd-party API, you want to make sure that you update the&amp;nbsp;&lt;SPAN&gt;Access-Control-Allow-Origin header, so that it includes the domain you are sending your API call from.&amp;nbsp;&lt;BR /&gt;So let's say I'm writing my JavaScript for a domain called example.com, on my API, I need to update the headers to include something like:&lt;BR /&gt;```&lt;BR /&gt;res.append('Access-Control-Allow-Origin', '&lt;A href="https://example.com" target="_blank"&gt;https://example.com&lt;/A&gt;')&lt;BR /&gt;```&lt;BR /&gt;That way, my incoming API call will be accepted.&lt;BR /&gt;If you do not have access to the code of the 3rd party API. You will probably have to send your data to a server first and send the data to the 3rd party API from there.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 21:01:05 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/955706#M72549</guid>
      <dc:creator>Teun</dc:creator>
      <dc:date>2024-04-05T21:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can't send form data to 3rd-party API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/955756#M72552</link>
      <description>&lt;P&gt;That's a good explanation, thank you very much for that. More research has led me to think a webhook might work in this situation. Do you know if I can create a webhook that fires when a specific form is submitted? This form creates a contact record. I want to send the data from certain fields in the form to the remote api. I do have access to webhooks. I made a dead simple one that currently just sends a test contact's info to a test endpoint I use. I'm just not familiar with this hubspot territory.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 23:29:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/955756#M72552</guid>
      <dc:creator>SRalston05</dc:creator>
      <dc:date>2024-04-05T23:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can't send form data to 3rd-party API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/955870#M72553</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/501715"&gt;@SRalston05&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have access to Operation Hub Webhooks? The kind you can use in a workflow? Or do you mean private app Webhooks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is the &lt;A href="https://knowledge.hubspot.com/workflows/how-do-i-use-webhooks-with-hubspot-workflows" target="_blank" rel="noopener"&gt;first&lt;/A&gt;, it is quite easy to set that up. And you can completely customise the request body.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is the second, you need to spin up your own endpoint and catch the incoming request with something like NodeJS or PHP.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2024 07:09:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/955870#M72553</guid>
      <dc:creator>Teun</dc:creator>
      <dc:date>2024-04-06T07:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can't send form data to 3rd-party API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/956927#M72595</link>
      <description>&lt;P&gt;The account I'm working in has the Marketing Hub Pro and CMS Hub Pro products. I have been able to make a simple workflow. Step 1 is a trigger based on someone submitting a specific form. Step 2 is sending a webhook. This worked once when I submitted the form but it hasn't worked since.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 23:08:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/956927#M72595</guid>
      <dc:creator>SRalston05</dc:creator>
      <dc:date>2024-04-08T23:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can't send form data to 3rd-party API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/957016#M72598</link>
      <description>&lt;P&gt;Did you set the re-enrollment correctly for the workflow? Because you should be able to trigger the workflow multiple times.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://knowledge.hubspot.com/workflows/add-re-enrollment-triggers-to-a-workflow" target="_blank"&gt;https://knowledge.hubspot.com/workflows/add-re-enrollment-triggers-to-a-workflow&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2024 04:56:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/957016#M72598</guid>
      <dc:creator>Teun</dc:creator>
      <dc:date>2024-04-09T04:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can't send form data to 3rd-party API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/958204#M72662</link>
      <description>&lt;P&gt;Another good clue, thank you. I allowed re-enrollment and I can now trigger the workflow repeatedly, but it seems like maybe it's re-enrolling the same user instead of creating new ones. I enter a user new name and email address for each test I do, but the notification emails I get have a subject of "Contact reconversion by submitting ...". And when I look at my contacts, all the previous contacts I have made via my form are gone, and the most recent contact has all email addresses of all the tests I've sent through my form.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 20:46:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/958204#M72662</guid>
      <dc:creator>SRalston05</dc:creator>
      <dc:date>2024-04-10T20:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can't send form data to 3rd-party API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/958350#M72666</link>
      <description>&lt;P&gt;That is the HubSpot tracking script magic.&lt;/P&gt;
&lt;P&gt;A cookie is set to identify the user, and because of it, it's not creating new contacts for each form submission.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a setting in the form editor to disable that behaviour, but I would advise against it to use in production.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 04:15:09 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/958350#M72666</guid>
      <dc:creator>Teun</dc:creator>
      <dc:date>2024-04-11T04:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can't send form data to 3rd-party API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/958865#M72694</link>
      <description>&lt;P&gt;Ah. I do have the 'always create a record' feature turned on right now, and testing in an incognito browser repeatedly does create new records.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your suggestions and input have been invaluable. Thank you very much!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 18:45:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/958865#M72694</guid>
      <dc:creator>SRalston05</dc:creator>
      <dc:date>2024-04-11T18:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can't send form data to 3rd-party API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/958867#M72695</link>
      <description>&lt;P&gt;Awesome! Happy I could help!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 18:48:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Can-t-send-form-data-to-3rd-party-API/m-p/958867#M72695</guid>
      <dc:creator>Teun</dc:creator>
      <dc:date>2024-04-11T18:48:06Z</dc:date>
    </item>
  </channel>
</rss>

