Back

Formsite API Essential Guide

Aug 16, 20246 minute read

What type of API does Formsite provide?

Formsite uses a REST API. Here are the key points about Formsite's API:

API Type

Formsite uses a REST API. The API is based on a REST model with JSON output.

Key Features

  • Uses REST architecture
  • Returns JSON responses
  • Requires a Pro 1 level or higher Formsite account to access

API Details

  • The API allows external applications to programmatically retrieve form results
  • Basic information needed to create API requests can be found on the form's "Settings -> Integrations -> Formsite API" page
  • This page includes:
    • The account's access token
    • The form's API base URL
    • IDs for referencing form items, form meta information, Results Views, etc.

Example Endpoints

Formsite's API includes endpoints like:

  • Get Forms: GET https://{server}.formsite.com/api/v2/{user_dir}/forms
  • Get Webhooks: GET https://{server}.formsite.com/api/v2/{user_dir}/forms/{form_dir}/webhooks

Authentication

The API uses an Access token (API key) for authentication. This token needs to be protected like the account password.

In summary, Formsite provides a REST API that allows developers to programmatically access form data and results, with JSON responses and standard REST conventions.

Does the Formsite API have webhooks?

Webhook Support

Yes, the official Formsite API does support webhooks.

Event Types

Currently, the only supported event type for webhooks is "result_completed". This means you can subscribe to be notified when a form result is completed.

Creating Webhooks

There are three main ways to create webhooks:

  1. Using the Server Post integration
  2. Programmatically through the webhooks API
  3. Using Zapier integration

Webhook API Endpoints

The Formsite API provides the following webhook-related endpoints:

  1. Create or Update Webhook: POST https://{server}.formsite.com/api/v2/{user_dir}/forms/{form_dir}/webhooks

  2. Get Webhooks: GET https://{server}.formsite.com/api/v2/{user_dir}/forms/{form_dir}/webhooks

  3. Delete Webhook: DELETE https://{server}.formsite.com/api/v2/{user_dir}/forms/{form_dir}/webhooks

Webhook Parameters

When creating or updating a webhook, you can specify the following parameters:

  • event: The event to subscribe to (currently only "result_completed")
  • handshake_key: Optional. A handshake key for added security.
  • url: The URL the webhook will post to when triggered.

Webhook Behavior

  • Webhooks will post to the specified URL each time a form result is completed.
  • The posted data will use the same format as the Get Results API endpoint.
  • If a handshake key is specified, it will be included in the posted object as an extra property named "handshake_key".
  • If a webhook receives a response with a 410 HTTP status code, it will automatically unsubscribe and delete itself.

API Access Requirements

It's worth noting that API access, including webhooks, requires a Pro 1 level or higher Formsite account.

In summary, while the Formsite API does support webhooks, the functionality is currently limited to subscribing to completed form results. This can be useful for real-time integrations and automations based on form submissions.

Rate Limits and other limitations

The API Rate Limits for the Formsite API are as follows:

Rate Limits

  • 50 API calls per minute
  • 10,000 total API calls per day

Key Points

  1. These limits apply to your Formsite account.

  2. If you exceed the rate limit, or if the server is too busy to handle your request, it will return an error with a 429 HTTP status code.

  3. The API is based on a REST model with JSON output.

  4. API access requires a Pro 1 level or higher Formsite account.

Additional Considerations

  • If you have a business case that requires higher limits, you can contact Formsite support to discuss your needs.

  • The API allows external applications to programmatically retrieve form results.

  • Basic information needed to create API requests can be found on your form's "Settings -> Integrations -> Formsite API" page, including your account's access token, form's API base URL, and IDs for referencing form items, meta information, and Results Views.

Best Practices

  1. Monitor your API usage to ensure you stay within the limits.

  2. If you consistently approach the limits, consider optimizing your API calls or contacting Formsite support for higher limits.

  3. Use the provided API documentation to ensure you're making efficient and correct API calls.

  4. Be aware of the different service levels and their respective features and limits when choosing or upgrading your Formsite account.

By understanding and adhering to these rate limits, you can effectively use the Formsite API while ensuring smooth operation of your applications and integrations.

Latest API Version

The most recent version of the Formsite API is v2. Here are the key points about the Formsite API:

API Version

  • The current version of the Formsite API is v2.

Key Points

  • The Formsite API allows external applications to programmatically retrieve form results.
  • It is based on a REST model with JSON output.
  • API access requires a Pro 1 level or higher Formsite account.

API Structure

  • The base URL for API calls is: https://{server}.formsite.com/api/v2/
  • Most API actions require the user directory (user_dir) and form directory (form_dir) in the URL.
  • Responses with a 200 HTTP status code indicate success, while 4xx and 5xx codes indicate errors.

Available Endpoints

The API provides several endpoints, including:

  • Get Forms: GET https://{server}.formsite.com/api/v2/{user_dir}/forms
  • Get Form: GET https://{server}.formsite.com/api/v2/{user_dir}/forms/{form_dir}
  • Get Form Results: GET https://{server}.formsite.com/api/v2/{user_dir}/forms/{form_dir}/results
  • Get Webhooks: GET https://{server}.formsite.com/api/v2/{user_dir}/forms/{form_dir}/webhooks

Authentication

  • API access requires an Access token (API key) for authorization.
  • The Access token can be found on the Form Settings -> Integrations -> Formsite API page.

Best Practices

  • URL parameters must be URL encoded.
  • Protect the Access token like you would protect your account password.
  • The API is read-only and does not allow adding, editing, or deleting data.

Use Cases

The Formsite API can be used for various purposes, including:

  • Creating custom dashboards
  • Automating report generation
  • Generating documents with result data
  • Automated data backups

Remember to refer to the official Formsite documentation for the most up-to-date and detailed information about using the API.

How to get a Formsite developer account and API Keys?

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

  1. Sign up for a Formsite account at the Pro 1 level or higher. The Formsite API is only available for Pro 1 accounts and above.

  2. Once you have a Pro 1 or higher account, you'll have access to the API functionality. There's no separate "developer account" needed - your regular Formsite account gives you API access.

  3. Go to your form's "Settings -> Integrations -> Formsite API" page. This page will contain the key information you need to use the API:

    • Your account's access token (API key)
    • Your form's API base URL
    • IDs for referencing form items, form meta information, Results Views, etc.
  4. Make note of your access token and API base URL. You'll need these to authenticate your API requests.

  5. The API base URL will be in this format: https://{server}.formsite.com/api/v2/

    Make sure to use the correct server prefix that matches your account.

  6. You can now start making API calls using your access token and the appropriate endpoints.

What can you do with the Formsite API?

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

Forms

  • Retrieve a list of all forms in the account
  • Get information about a specific form, including name, link, and number of results

Form Items

  • Retrieve all items in a form with their IDs and labels
  • Access form item IDs for referencing in other API calls

Results

  • Retrieve form results
  • Apply various filters and parameters to the results query, such as:
    • Limit the number of results returned
    • Paginate through results
    • Filter results by date range
    • Filter results by result ID range
    • Sort results by specific items
    • Apply a specific Results View
    • Search for results based on item values

Webhooks

  • Create, edit, and delete webhooks for a form

Meta Information

  • Access form meta information IDs

Results Views

  • Apply specific Results Views when retrieving results

Account Information

  • Retrieve the account's access token (API key)
  • Get the API base URL for the account

It's important to note that the Formsite API is read-only, meaning you can only retrieve data and cannot add, edit, or delete any data using the API. The API allows for custom integrations and workflows, such as creating custom dashboards, automating reports, generating documents with result data, and performing automated data backups.