Hey, all.
I’m new to the HS API and taking over a project with a new form. Older form submissions are working and I’m using the same code (except for the data fields) to send the XHR request.e
I’m only getting this error with the new form with no response data, so I was wondering what’s the most common way to troubleshoot this error.
Here’s the request data for a valid request:
Request URL: https://api.hsforms.com/submissions/v3/integration/submit/PORTAL_ID/FORM_ID
Request Method: POST
Status Code: 200
Remote Address: [2606:4700::6811:d2f3]:443
Referrer Policy: strict-origin-when-cross-origin
Response Headers:
access-control-allow-credentials: false
access-control-allow-headers: *
access-control-allow-methods: OPTIONS, POST
access-control-allow-origin: http://localhost
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
cache-control: max-age=0, no-cache, no-store
cf-cache-status: DYNAMIC
cf-ray: 7c45e119ba6fc360-EWR
content-encoding: br
content-type: application/json;charset=utf-8
date: Tue, 09 May 2023 00:38:23 GMT
server: cloudflare
strict-transport-security: max-age=31536000; includeSubDomains; preload
vary: origin, Accept-Encoding
x-envoy-upstream-service-time: 63
x-evy-trace-listener: listener_https
x-evy-trace-route-configuration: listener_https/all
x-evy-trace-route-service-name: envoyset-translator
x-evy-trace-served-by-pod: iad02/star-hubspot-td/envoy-proxy-58fd596dd9-tpxx8
x-evy-trace-virtual-host: all
x-hubspot-correlation-id: e8617809-401b-4691-8fa8-6059ee12842e
x-request-id: 9473dba0-8bac-4a60-a13d-f853a7071c16
x-trace: 2B7759DEB725058F3FEC1CB3D8BCBF743064A40E6B000000000000000000
Request Headers:
:authority: api.hsforms.com
:method: POST
:path: /submissions/v3/integration/submit/PORTAL_ID/FORM_ID
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
cache-control: no-cache
content-length: 529
content-type: application/json
origin: http://localhost
pragma: no-cache
referer: http://localhost/
sec-ch-ua: "Chromium";v="112", "Google Chrome";v="112", "Not:A-Brand";v="99"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
Request Payload:
{submittedAt: 1683592703764,…}
context
:
{hutk: null, ipAddress: "::1", pageUri: "URI", pageName: "Map"}
hutk
:
null
ipAddress
:
"::1"
pageName
:
"Map"
pageUri
:
"URI"
fields
:
[{name: "email", value: "test@test.com"}, {name: "firstname", value: "test"},…]
0
:
{name: "email", value: "test@test.com"}
1
:
{name: "firstname", value: "test"}
2
:
{name: "lastname", value: "test"}
3
:
{name: "company", value: "test"}
4
:
{name: "events_you_host", value: ""}
5
:
{name: "phone", value: "1111111111"}
6
:
{name: "website", value: "google.com"}
7
:
{name: "receive_updates_and_special_offers_via_sms", value: "Yes"}
8
:
{name: "campaign", value: "Inbound - Maps Page"}
submittedAt
:
1683592703764
Here’s the request data of an invalid request to a new form:
Request URL: https://api.hsforms.com/submissions/v3/integration/submit/PORTAL_ID/FORM_ID
Request Method: POST
Status Code: 400
Remote Address: [2606:4700::6811:d2f3]:443
Referrer Policy: strict-origin-when-cross-origin
Response Data:
access-control-allow-credentials: false
access-control-allow-headers: *
access-control-allow-methods: OPTIONS, POST
access-control-allow-origin: http://localhost
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
cache-control: max-age=0, no-cache, no-store
cf-cache-status: DYNAMIC
cf-ray: 7c462ef688a93b82-BOS
content-type: application/json;charset=utf-8
date: Tue, 09 May 2023 01:31:32 GMT
server: cloudflare
strict-transport-security: max-age=31536000; includeSubDomains; preload
vary: origin, Accept-Encoding
x-envoy-upstream-service-time: 49
x-evy-trace-listener: listener_https
x-evy-trace-route-configuration: listener_https/all
x-evy-trace-route-service-name: envoyset-translator
x-evy-trace-served-by-pod: iad02/star-hubspot-td/envoy-proxy-58fd596dd9-429sg
x-evy-trace-virtual-host: all
x-hubspot-correlation-id: d6b39d1d-c8d9-4390-a4c4-5469d0524762
x-request-id: b239c9d6-c43d-4365-af88-caa4a1a5db1d
x-trace: 2B483D29BD1401650CA177ACCDDD4B32350BDF3724000000000000000000
Request Data:
:authority: api.hsforms.com
:method: POST
:path: /submissions/v3/integration/submit/PORTAL_ID/FORM_ID
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
cache-control: no-cache
content-length: 431
content-type: application/json
origin: http://localhost
pragma: no-cache
referer: http://localhost/
sec-ch-ua: "Chromium";v="112", "Google Chrome";v="112", "Not:A-Brand";v="99"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
Payload:
{submittedAt: 1683595893115,…}
context
:
{hutk: null, ipAddress: "::1", pageUri: "URI",…}
hutk
:
null
ipAddress
:
"::1"
pageName
:
"EventIndex"
pageUri
:
"URI"
fields
:
[{name: "email", value: "test@test.com"}, {name: "firstname", value: "test"},…]
0
:
{name: "email", value: "test@test.com"}
1
:
{name: "firstname", value: "test"}
2
:
{name: "lastname", value: "test"}
3
:
{name: "company", value: "org"}
4
:
{name: "phone", value: "1111111111"}
5
:
{name: "website", value: "google.com"}
6
:
{name: "campaign", value: "Inbound - Index"}
submittedAt
:
1683595893115
I have omitted the URI data as well as portal id and form id.
Thanks for your time!