# Empty response from HubSpot form submission API

**URL:** <https://community.hubspot.com/t/empty-response-from-hubspot-form-submission-api/121007>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [November 20, 2024, 7:27pm UTC](https://community.hubspot.com/t/empty-response-from-hubspot-form-submission-api/121007 "2024-11-20T19:27:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerardo\_S](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@Gerardo\_S](https://community.hubspot.com/u/Gerardo_S)\
**Post date:** [November 20, 2024, 7:27pm UTC](https://community.hubspot.com/t/empty-response-from-hubspot-form-submission-api/121007/1 "2024-11-20T19:27:43Z")

</div>

Hello

I am trying to use the HubSpot form API to send information to a form using fields I made with HTML. This is the code:

var formDataA = new FormData(document.getElementById(‘form1’));  
var formDataB = new FormData(document.getElementById(‘cotizador\_paso2’));  
var combinedFormData = new FormData();  
combinedFormData.append(‘firstname’, formDataA.get(‘firstname’));  
combinedFormData.append(‘lastname’, formDataA.get(‘lastname’));  
combinedFormData.append(‘email’, formDataA.get(‘email’));  
combinedFormData.append(‘phone’, formDataA.get(‘phone’));  
combinedFormData.append(‘escuela\_de\_procedencia’, formDataB.get(‘cotizador\_datospreuniversitario\_escuela’));  
combinedFormData.append(‘estado\_de\_procedencia’, formDataB.get(‘cotizador\_datospreuniversitario\_estado’));  
combinedFormData.append(‘periodo\_de\_ingreso’, formDataB.get(‘cotizador\_datosgenerales\_periodoingreso’));  
combinedFormData.append(‘licenciatura\_de\_interes’, formDataB.get(‘cotizador\_datosgenerales\_licenciatura’));  
combinedFormData.append(‘eres\_preuniversitario\_o\_padre\_de\_familia\_’, ‘Padre de familia’);

fetch(`[https://api.hsforms.com/submissions/v3/integration/submit/myFormID/myPortalID\`](https://api.hsforms.com/submissions/v3/integration/submit/myFormID/myPortalID%5C%60), {  
method: ‘POST’,  
headers: {  
‘Content-Type’: ‘application/json’  
},  
body: JSON.stringify(Object.fromEntries(combinedFormData))  
})  
.then(response =\> response.json())  
.then(data =\> {  
console.log(‘Success:’, data);

alert(“Thanks!”);  
})  
.catch((error) =\> {  
console.error(‘Error:’, error);  
});

The request gets sent successfully, but this is what I receive on the other side:

 ![Gerardo_S_0-1732130407371.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/9/a/9a0b15af0df5bfa8678ccc6383c413a458d323c2.png)

And all the fields are empty.

If you guys could help me with this I would really appreciate it.

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [November 21, 2024, 10:39am UTC](https://community.hubspot.com/t/empty-response-from-hubspot-form-submission-api/121007/2 "2024-11-21T10:39:08Z")

</div>

Hi [@Gerardo\_S](https://community.hubspot.com/t5/user/viewprofilepage/user-id/860212) and welcome, we are delighted to have you here!  
Thanks for asking the Community!  
You are trying to update contact properties once a form has been submitted. Please let me know if that’s not the case.  
I’d like to share these documentation that might help you:  
- [Imports API](https://developers.hubspot.com/beta-docs/guides/api/crm/imports)  
- [Update contacts API](https://developers.hubspot.com/beta-docs/guides/api/crm/objects/contacts#update-contacts)  
- [Properties API](https://developers.hubspot.com/beta-docs/guides/api/crm/properties)  
I also wanted to invite a couple of subject matter experts to this conversation: Hi @Teun, @SRalston05, @GRajput and [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811) do you have tips to share with [@Gerardo\_S](https://community.hubspot.com/t5/user/viewprofilepage/user-id/860212), please?  
Thanks so much and have a great day!  
Best,  
Bérangère

---

<div class="post-metadata">

**Author:** ![Gerardo\_S](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@Gerardo\_S](https://community.hubspot.com/u/Gerardo_S)\
**Post date:** [November 21, 2024, 9:14pm UTC](https://community.hubspot.com/t/empty-response-from-hubspot-form-submission-api/121007/3 "2024-11-21T21:14:37Z")

</div>

Hello, thank you for your prompt response.

Actually, what I’m trying to do is use the “Submit Data for a Form API”. I’ve been using this documentation as a reference: [Forms API V3 documentation](https://developers.hubspot.com/beta-docs/reference/api/marketing/forms/v3-legacy#submit-data-to-a-form-supporting-authentication)

When I fill out the form the normal way, the data appears on the submissions tab as normal. However, when I try to send data the way I’m doing in the code, all the columns are empty and it displays some error messages. Here’s what it looks like:

 ![Gerardo_S_0-1732223578045.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/9/69cfd2f2d0719c24fae3ad671d9a71554e2e6837.png)

--

 ![Gerardo_S_1-1732223618044.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/e/be19d021ce384d3e80fd1fcfffb25b499253ecd2.png)

--

 ![Gerardo_S_2-1732223651331.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/a/2a0052216f23d83af4a62141473ee1d70a697472.png)

--

If you need any more details please by all means ask.

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [February 10, 2025, 2:59pm UTC](https://community.hubspot.com/t/empty-response-from-hubspot-form-submission-api/121007/4 "2025-02-10T14:59:57Z")

</div>

Hi [@Gerardo\_S](https://community.hubspot.com/t5/user/viewprofilepage/user-id/860212), thank you for the information and screenshots!  
I’d love to put you in touch with some of our Top Experts: Hi [@sylvain\_tirreau](https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366), @MBERARD and [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811) do you have suggestions to help [@Gerardo\_S](https://community.hubspot.com/t5/user/viewprofilepage/user-id/860212), please?  
Have a lovely day and thanks so much!  
Best,  
Bérangère

---

<div class="post-metadata">

**Author:** ![zach\_threadint](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zach_threadint/32/46318_2.png) [@zach\_threadint](https://community.hubspot.com/u/zach_threadint)\
**Post date:** [February 10, 2025, 10:27pm UTC](https://community.hubspot.com/t/empty-response-from-hubspot-form-submission-api/121007/5 "2025-02-10T22:27:04Z")

</div>

Hi [@Gerardo\_S](https://community.hubspot.com/t5/user/viewprofilepage/user-id/860212) 👋

A couple of thoughts:

1. You’ve specified your API endpoint as _[https://api.hsforms.com/submissions/v3/integration/submit/\*\*myFormID\*\*/\*\*myPortalID](https://api.hsforms.com/submissions/v3/integration/submit/ **myFormID** /**myPortalID)\*\*_
  1. HubSpot’s documentation has the portal ID path parameter first, then the Form GUID, e.g. _[https://api.hsforms.com/submissions/v3/integration/secure/submit/\*\*:PORTAL\_ID\*\*/\*\*:FORM\_GUID](https://api.hsforms.com/submissions/v3/integration/secure/submit/ **:PORTAL%5C_ID** /**:FORM%5C_GUID)\*\*_

2. I think it could be helpful for you to share an example request body -- i.e. the contents of _Object.fromEntries(combinedFormData)_

I hope that proves helpful. Please let me know if you have any follow-up questions.

---

<div class="post-metadata">

**Author:** ![sylvain\_tirreau](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sylvain_tirreau/32/67408_2.png) [@sylvain\_tirreau](https://community.hubspot.com/u/sylvain_tirreau)\
**Post date:** [February 10, 2025, 5:58pm UTC](https://community.hubspot.com/t/empty-response-from-hubspot-form-submission-api/121007/6 "2025-02-10T17:58:19Z")

</div>

Hi,

Perhaps your json data are not well shaped.

You send this:

```lia-code-sample
{
"firstname": "John",
"lastname": "Doe",
"email": "john@example.com",
...
}

```

But I think you should send this:

```lia-code-sample
{
"fields": [
{ "name": "firstname", "value": "John" },
{ "name": "lastname", "value": "Doe" },
{ "name": "email", "value": "john@example.com" },
// etc.
],
"context": {
"pageUri": "https://www.example.com/your-page",
"pageName": "Your Page Name"
}
}

```

Tell us if it works like that.

Best
