Back

Formstack API Essential Guide

Aug 13, 20246 minute read

What type of API does Formstack provide?

API Type

Formstack uses a REST API. The documentation explicitly states that "The Formstack API allows users and 3rd party application to access resources programmatically. This API tries to conform to REST principals."

Key Features of Formstack's REST API

  1. Request Formats: The API accepts two request data types - HTTP url encoded query parameters and JSON.

  2. Response Formats: It offers two response types - JSON (default) and XML.

  3. Authentication: The API uses OAuth2 access tokens for authentication.

  4. Rate Limits: The API is rate limited to 14,400 calls per access token per day.

Best Practices

  1. When making API calls, include the access token in the HTTP Authorization header:

    Authorization: Bearer <access-token>
    
  2. For GET requests, you can also set the access token as part of the query string:

    https://www.formstack.com/api/v2/form.json?oauth_token=abcdefg123456
    
  3. Be mindful of the rate limits when designing your application to interact with the Formstack API.

Does the Formstack API have webhooks?

Yes, the official Formstack API does have webhooks. Here are the key points about Formstack's webhook functionality:

Webhook Availability

  • Formstack supports webhooks as a way to send form submission data to a specified URL when a form submission occurs.

  • Webhooks can be used in place of or as a supplement to the Formstack API.

Setting Up Webhooks

  • Webhooks are configured on a form-by-form basis through the form's Settings tab.

  • To add a webhook:

    1. Select your form from the form dashboard
    2. Go to the "After the form is submitted" section
    3. Click "Click here to change"
    4. Select "Send Data to an External URL (WebHook)"
    5. Click "OK" to save the webhook

Webhook Configuration Options

Formstack provides several options to customize how data is sent to your webhook URL:

  1. Post without sub-field names - Sends complex fields (like Name or Address) as a simple string instead of separate subfields.

  2. Post using field IDs instead of field names - Uses numeric field IDs as keys instead of field names.

  3. Post with field type - Includes the field type for each field in the submission data.

  4. Post with API-friendly field keys - Uses unique labels for each field as keys.

Security Options

Formstack offers two security options for webhooks:

  1. Shared Secret - A shared key sent with each request to verify it's coming from Formstack.

  2. HMAC Key - Used to sign the webhook payload so you can verify its authenticity and integrity.

Events

While the search results don't explicitly list the types of events you can subscribe to, it's clear that form submissions trigger webhooks. The primary event appears to be:

  • Form submission

Best Practices

  • Use SSL/TLS on your webhook endpoint to ensure data security during transmission.
  • Test webhooks using a service like Request Bin before implementing them in production.
  • Be aware of field identifier uniqueness when using certain webhook options to avoid data loss.

In summary, Formstack's API does offer webhook functionality, primarily focused on sending form submission data to specified URLs. The webhooks are highly configurable and include security options to ensure data integrity and authenticity.

Rate Limits and other limitations

Here are the key points about the API rate limits for the Formstack API:

Rate Limit Details

  • The Formstack API is rate limited to 14,400 calls per access token per day [1].

Key Considerations

  • This rate limit is applied per access token, not per account or user.
  • The limit resets daily.
  • Exceeding this limit will result in API requests being rejected.

Best Practices

  • Monitor your API usage to avoid hitting the rate limit.
  • If you need to make a large number of API calls, consider spreading them out over time.
  • Use efficient API practices like batching requests where possible to minimize the number of individual calls.

Handling Rate Limits

  • If you hit the rate limit, you'll need to wait until the next day for it to reset before making additional API calls.
  • Consider implementing exponential backoff in your code to handle rate limit errors gracefully.

Additional Information

  • The API accepts both HTTP URL encoded query parameters and JSON for request data [1].
  • Responses can be in JSON (default) or XML format [1].
  • Authentication is done via OAuth2 access tokens [1].

By understanding and working within these rate limits, you can ensure reliable and consistent access to the Formstack API for your applications.

Latest API Version

Based on the search results provided, here are the key points about the most recent version of the Formstack API:

Most Recent Version

The most recent version of the Formstack API appears to be V4 (Version 4) [1].

Key Points

  • V4 is the latest update to Formstack's form building engine [1].

  • It is built with modern technologies like React and TypeScript [1].

  • While the form builder interface hasn't changed significantly, there are major improvements "under the hood" [1].

  • The update aims to align with industry standards and allow more flexibility in form interactions and manipulations [1].

  • It enables Formstack to be more agile with future improvements and feature additions [1].

API Details

  • The Formstack API accepts HTTP url encoded query parameters and JSON request formats [2].

  • It offers JSON (default) and XML response formats [2].

  • The API is rate limited to 14,400 calls per access token per day [2].

  • A list of all API methods (exposed as REST resources) is available in the Formstack API documentation [2].

Considerations

  • Custom code written for previous versions may need to be updated to be compatible with V4 [1].

  • Formstack recommends creating duplicates of existing forms before updating to the latest API version [3].

  • While Formstack provides API access on all paid accounts, their support team does not assist with troubleshooting custom API setups [4].

In summary, V4 is the most recent version of the Formstack API, offering improved technology and flexibility while maintaining the familiar form builder interface. Developers should be aware of potential compatibility issues when upgrading from previous versions.

How to get a Formstack developer account and API Keys?

To get a developer account for Formstack to create an API integration, you can follow these steps:

  1. Sign up for a Formstack account if you don't already have one. You'll need an account with admin access to create API applications.

  2. Log in to your Formstack account as an admin user.

  3. Click on your name in the top right corner and select "API" from the dropdown menu.

  4. On the API page, click "Create new application".

  5. Fill out the required information for your API application, including:

    • Application name
    • Redirect URL
    • Description
  6. The application will be created automatically after you fill out the details.

  7. Go back to the API home page by selecting "API" from the panel.

  8. You'll now see your newly created API v2 application listed. Click on its name to view the details.

  9. On the application details page, you'll find the following important information:

    • Client ID
    • Client secret
    • Redirect URL
    • Your access token
    • Dashboard to view users and API calls

What can you do with the Formstack API?

Based on the provided information, here is a list of data models you can interact with using the Formstack API, along with what is possible for each:

Forms

  • GET: Retrieve all forms in an account or details for a single form
  • POST: Add a new form to the account or copy an existing form
  • PUT: Update a specified form
  • DELETE: Delete a specified form

Fields

  • GET: Retrieve all fields from a single form or details for a single field
  • POST: Add a new field to a specified form
  • PUT: Update a specified field
  • DELETE: Delete a specified field

Folders

  • GET: Retrieve all folders and subfolders in an account or details for a single folder/subfolder
  • POST: Add a new folder or subfolder to the account
  • PUT: Update a specified folder
  • DELETE: Delete a specified folder (moves all forms within it to the Uncategorized folder)

Submissions

  • GET: Retrieve all submissions from a specified form or details from a specific submission
  • POST: Add a new submission for the specified form
  • PUT: Update a specified submission
  • DELETE: Delete a specified submission

Partial Submissions

  • GET: Retrieve all partial submissions from a specified form or details from a specific partial submission
  • DELETE: Delete a specified partial submission

Confirmation Emails

  • GET: Retrieve all confirmation emails from a specified form or details from a specific confirmation email
  • POST: Add a new confirmation email for the specified form
  • PUT: Update a specified confirmation email
  • DELETE: Delete a specified confirmation email

Notification Emails

  • GET: Retrieve all notification emails from a specified form or details from a specific notification email
  • POST: Add a new notification email for the specified form
  • PUT: Update a specific notification email
  • DELETE: Delete a specified notification email

WebHooks

  • GET: Retrieve all WebHooks from a specified form or details from a specific WebHook
  • POST: Add a new WebHook for the specified form
  • PUT: Update a specified WebHook
  • DELETE: Delete a specified WebHook

Field Logic

  • Ability to apply conditional logic to fields on your form to conditionally show or hide them

Field Calculations

  • Ability to add a calculation to a number field within your form

API Connector (for Workflows)

  • Can be placed as the first step in a workflow, after a forms step, or before/after a Docs or Sign step
  • Supports GET requests for prefilling workflow steps
  • Supports DELETE requests for deleting information in 3rd party systems
  • Allows mapping of prefilled information to future workflow steps

This list covers the main data models and operations available through the Formstack API, providing a comprehensive overview of the possibilities for interacting with Formstack data programmatically.