sharepa Docs

Form endpoint

Accepts the entries of a form. Only reachable from the page itself, at its own address.

Request#

POST/__sharepa/formular

Body as application/x-www-form-urlencoded, multipart/form-data or application/json (flat object).

Fields#

  • anyText, number, list of textYour fields. At most 50, names up to 100 characters, values up to 10,000 characters.
  • _honigTextBot trap, must stay empty.
  • _formularTextName of the form, up to 60 characters.
  • _weiterPathWhere to go after sending, on the same page.

Headers#

  • acceptapplication/jsonAnswer as JSON instead of redirecting to the thank-you page.
JavaScript
const r = await fetch("/__sharepa/formular", {
  method: "POST",
  headers: {
    "content-type": "application/json",
    accept: "application/json",
  },
  body: JSON.stringify({
    _formular: "Waitlist",
    email: "anna@example.com",
  }),
});

Response#

Without accept: application/json, sharepa redirects with status 303, to _weiter or the thank-you page. With JSON:

  • okBooleantrue when the entry is stored.
  • fehlerTextOnly with ok: false. One of the error codes below.
Response 200
{ "ok": true }
Response 422
{ "ok": false, "fehler": "formular.heikel" }

Error codes#

CodeStatusMeaning
formular.herkunft403The request did not come from the page itself.
formular.gesperrt401The page has a password, and the visitor has not unlocked it.
formular.zuGross413The entry is larger than 100 KB.
formular.ungueltig422The body could not be read, it has no fields, more than 50 fields, a name over 100 or a value over 10,000 characters.
formular.heikel422A field looks like password, payment or health data.
formular.langsam429Too many entries in a short time from the same visitor.
formular.grenze429The limit of the page or the account is reached.

Last updated