Typeform primarily uses RESTful APIs for its services. The Create and Responses APIs are RESTful, allowing users to interact with Typeform programmatically. These APIs enable functionalities such as creating typeforms, retrieving responses on demand, and integrating with webhooks for automatic delivery of submissions.
REST (Representational State Transfer) APIs operate based on standard HTTP methods, such as GET, POST, PUT, and DELETE, and exchange data in a format that is easy to understand and use, typically JSON.
Key characteristics of REST APIs, as demonstrated by Typeform's implementation, include:
Typeform's use of RESTful APIs offers a scalable, flexible, and efficient way for developers to integrate Typeform's functionalities into their applications or services.
Yes, the Typeform API supports webhooks. Webhooks notify you automatically when a specific event occurs, primarily when a new response is submitted to a form. The webhook sends a notification containing the response data to your designated URL or web application. Your webhook should respond with a 2XX
HTTP status code to acknowledge receipt.
To work with Typeform webhooks:
PUT
request to the Typeform API with the form's form_id
, your webhook URL, and set enabled
to true
.curl --request PUT \ --url https://api.typeform.com/forms/{form_id}/webhooks/{tag} \ --header 'Authorization: bearer {your_access_token}' \ --header 'Content-Type: application/json' \ -d '{"url":"https://{your_webhook_url}.com", "enabled":true}'
Update a Webhook:
Send another PUT
request with the new webhook URL, keeping enabled
set to true
.
Delete a Webhook:
Send a DELETE
request to the Typeform API with the form's form_id
and the webhook tag.
curl --request DELETE \ --url https://api.typeform.com/forms/{form_id}/webhooks/{tag} \ --header 'Authorization: bearer {your_access_token}'
Typeform supports security measures for webhooks, such as payload signing and HTTPS, and implements a retry mechanism for failed webhook deliveries.
The Typeform API imposes rate limits on the usage of its services to ensure fair usage and maintain service quality. Specifically, for the Create and Responses APIs, users are allowed to send two requests per second per Typeform account. It's important to note that these rate limits apply to the Create and Responses APIs only. For other components such as Webhooks and Embed, since they do not require you to actively make requests, rate limits do not apply to them.
This means that when integrating with Typeform's API, especially when creating new forms or fetching responses, developers need to design their applications to stay within this limit to avoid potential throttling or temporary blocking of their requests. Implementing efficient request handling and possibly caching mechanisms can help manage the rate limits effectively.
Additionally, when working with the Responses API, it's worth noting that by default, retrieving responses will yield 25 responses per request. However, this can be adjusted using the page_size
parameter, with a maximum value of 1000 responses per request. This allows for more granular control over how much data is retrieved in each call, which can be particularly useful for managing rate limits and optimizing performance.
In summary, the Typeform API rate limits are as follows:
Understanding and adhering to these limits is crucial for maintaining a smooth operation of applications integrated with Typeform's services.
The most recent update to the Typeform API, based on the provided changelog, occurred on July 1st, 2024. This update introduced the ability to set enrichment settings for forms via the API for accounts with access to the responses enrichment feature. Additionally, it allowed for creating or updating milestones within a form definition through the Create API. The Responses API was enhanced to fetch partial responses, introducing a new response_type
query parameter for more detailed control over the responses retrieved.
To get a developer account for Typeform to create an API integration, you don't need a special developer account. All you need is a regular Typeform account. Some features require a PRO or PRO+ account, but basic developer features and API access are available for standard Typeform accounts.
Here's a step-by-step guide to setting up API integration with Typeform:
If you don't already have a Typeform account, sign up for one. A standard Typeform account grants you access to their APIs.
To use Typeform's APIs, you'll need to register your application in the Typeform admin panel. During registration, you'll specify your application's website URL and redirect URI(s), and upon completion, you'll receive a client_id
and client_secret
for your application.
After registering your application, you'll need to obtain an access token to authenticate your API requests. This involves implementing OAuth 2.0 authentication in your application. You'll make an authorization request to https://api.typeform.com/oauth/authorize
with parameters including your client_id
, redirect_uri
, and the scope of access your application requires. Upon successful authorization, you'll exchange the temporary authorization code for an access token by making a POST request to https://api.typeform.com/oauth/token
.
Here's an example of what the authorization request URL might look like:
https://api.typeform.com/oauth/authorize?state=xyz789&client_id={your_client_id}&redirect_uri=https://results-example.herokuapp.com/callback&scope={scope1}+{scope2}+{scope3}
Replace {your_client_id}
, {scope1}+{scope2}+{scope3}
, and https://results-example.herokuapp.com/callback
with your actual client ID, scopes, and redirect URI.
Keep your access tokens, refresh tokens, client_id
, and client_secret
secure. Do not commit them to source control or expose them publicly. Use placeholders in your code and store these credentials securely.
Based on the information gathered from the sources, here's a breakdown of the data models you can interact with using the Typeform API and what is possible for each:
Each of these data models opens up a variety of possibilities for interacting with and analyzing the data collected through Typeform. Whether you're looking to perform advanced analytics, consolidate data across platforms, analyze historical trends, enhance data security, scale your data handling capabilities, apply machine learning, or simply report and visualize your findings, the Typeform API provides the necessary tools and endpoints to achieve these goals.