All docs
2 min read

Receive your first submission

The endpoint accepts both application/x-www-form-urlencoded (HTML forms) and application/json (fetch calls and APIs). Both return a 200 OK with a JSON body when a submission is accepted.

Plain HTML

<form action="https://formspring.io/f/r2EdO-orF-3S" method="POST">
  <label>Email
    <input type="email" name="email" required>
  </label>
  <label>Message
    <textarea name="message" required></textarea>
  </label>
  <input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
  <button type="submit">Send</button>
</form>

The hidden _gotcha field is a honeypot. Bots fill it; humans don't. Submissions where it's non-empty land silently in the spam folder so the bot keeps thinking it succeeded.

Fetch (JSON)

const response = await fetch('https://formspring.io/f/r2EdO-orF-3S', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Accept: 'application/json',
  },
  body: JSON.stringify({ email, message }),
});

const { ok, id, status } = await response.json();

ok: true means we accepted it. status is received for clean submissions and spam for filtered ones.

What the response looks like

{
  "ok": true,
  "id": "01HFXX0X9R7KZJVN9VS6TG2C5T",
  "status": "received",
  "redirect": null
}

If you set a redirect_url on the form, that URL comes back in redirect so your frontend can follow it after a successful submit.

What to do next