I’m in a React/Next.js project and trying to test the v3 form submit API endpoint.
I’m using the axios package to send the POST request, here is my code:
import axios from 'axios';
export const submit_hs_form = async () => {
const portalId = 'my_portal_id';
const formGuid = 'my_form_guid';
const res = await axios.post(
`https://api.hsforms.com/submissions/v3/integration/submit/${portalId}/${formGuid}`,
{
portalId,
formGuid,
fields: [
{
name: 'email',
value: 'sdfsfd33@gmail.com',
},
],
}
);
return res;
};
Every time I call the function, I get no response. The request hangs for over 10 seconds and then nothing happens, and I don’t see anything new submissions in my forms dashboard in HubSpot.
Anybody have any idea why this might be happening?
This is just a regular function I am calling from my frontend.