Formstack¶
Overview¶
Formstack is a service that provides an advanced online form builder. This connector allows you to load data from the Formstack API.
Authentication
Formstack uses OAuth2 user access tokens to handle authentication. “Access tokens are tied to a Formstack user and follow Formstack (in-app) user permissions.” You can acquire an OAuth2 token in the Formstack API overview.
You can pass the token to the Formstack
object as the api_token keyword argument, or you can set the environment
variable FORMSTACK_API_TOKEN.
Quickstart¶
To instantiate the Formstack class,
you can either store your access token in the FORMSTACK_API_TOKEN
environment variable or pass it in as an argument.
FORMSTACK_API_TOKEN environment variable¶from parsons.formstack import Formstack
fs = Formstack()
from parsons.formstack import Formstack
fs = Formstack(api_token="<your api token>")
folders = fs.get_folders()
data_folder_id = None
for folder in folders:
if folder["name"] == "Data":
data_folder_id = folder["id"]
break
if data_folder_id is not None:
forms = fs.get_forms(folder_id=data_folder_id)
print(forms)
API¶
- class parsons.formstack.formstack.Formstack(api_token: str | None = None)[source]¶
Instantiate Formstack class.
- Parameters:
api_token (str | None) – API token to access the Formstack API. Not required if the
FORMSTACK_API_TOKENenv variable is set.
- get_folders() Table[source]¶
Get all folders on your account and their subfolders.
- Returns:
- Table Class
A Table with the folders data.
- Return type:
- get_forms(form_name: str | None = None, folder_id: int | None = None) Table[source]¶
Get all forms on your account.
- get_form_submissions(form_id: int, **query_params) Table[source]¶
Get all submissions for the specified form.
Note this only returns the meta-data about the submissions, not the answer data, by default. To get the responses pass data=True as a query param.
For more useful options, such as how to filter the responses by date, check the Formstack documentation.