Forms API

End-points

Action Method URL
Retrieve all forms on the account GET /api/v1/forms
Create a new Form POST /api/v1/forms
View a form GET /api/v1/forms/:identifier
Check if a value has already been submitted GET /api/v1/forms/:identifier/value_exists/?field=email&value=john@example.com

Object

{
  "id":1,
  "name":"my new form",
  "identifier":"e007c41afeaf82d8",
  "submission_text":"Thanks for your submission",
  "webhook_url":null,
  "redirect_url":null,
  "notify_submitter":true,
  "notify_submitter_from":"jesper@formbackend.com",
  "notify_submitter_subject":"Thanks for your submission",
  "notify_submitter_body":"Thanks for your submission",
  "notify_owner_on_submission":true,
  "notify_owner_emails":"jesper@formbackend.com,john@example.com",
  "show_submitted_values":false,
  "bg_color":"#fff",
  "text_color":"#000",
  "link_color":"red",
  "whitelisted_domains":null
}

List all forms

curl -H 'Authorization: Bearer exampletoken' -X POST https://www.formbackend.com/api/v1/forms
{
  "forms": [
    {
      "id": 1,
      "name": "My test form",
      "identifier": "2fc637ed03b374c5",
      "submission_count": 4
    },
    {
      "id": 5,
      "name": "Contact form",
      "identifier": "5ce8efebad6ae0a4",
      "submission_count": 27
    }
  ]
}

Create a new form

curl -H 'Authorization: Bearer exampletoken' -X POST \
  -d '{"form": {"name":"My form"}}' -H "Content-Type: application/json" \
  https://www.formbackend.com/api/v1/forms/

View a form

curl -H 'Authorization: Bearer exampletoken' -X POST https://www.formbackend.com/api/v1/forms/uniquetoken
{
  "id": 1,
  "name": "sdfsdf",
  "identifier": "2fc637ed03b374c5",
  "submission_text": "Thank you for your submission",
  "webhook_url": null,
  "redirect_url": null,
  "notify_submitter": null,
  "notify_submitter_from": null,
  "notify_submitter_from_name": null,
  "notify_submitter_subject": null,
  "notify_submitter_body": null,
  "notify_owner_on_submission": false,
  "notify_owner_emails": null,
  "show_submitted_values": false,
  "bg_color": null,
  "text_color": null,
  "link_color": null,
  "whitelisted_domains": null,
  "submission_count": 4
}

Check if value has already been submitted

curl -H 'Authorization: Bearer exampletoken' \
  -X POST https://www.formbackend.com/api/v1/forms/uniquetoken/value_exists?field=email&value=john@example.com
{
  "field": "email",
  "value": "john@example.com",
  "exists": true
}