The markup that did this
This page uses fetch so it can show you the response. It does not have to —
the same form works with no JavaScript at all. Set action to your endpoint and the
backend redirects to your thank-you page on success:
<form action="https://api.example.com/f/YOUR_FORM_ID" method="POST"
enctype="multipart/form-data">
<input name="name" required>
<input name="email" type="email" required>
<input name="topics" type="checkbox" value="sales">
<input name="topics" type="checkbox" value="support">
<textarea name="message"></textarea>
<input name="attachment" type="file">
<!-- bots fill this in; people never see it -->
<input name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
<button>Send it</button>
</form>
Send content-type: application/json and you get JSON back
({"ok":true,"id":"…"}). Post it as a form and you get a 302 to your
redirectUrl, or to the hosted thank-you page if you have not set one.