表单堆栈 API 参数
Formstack API parameters
我正在尝试使用表单堆栈 API 将一些提交内容下载到我的计算机上。我可以下载所有提交,但我想下载字段等于某个值的记录(类似于在 SQL 中使用 where
)。
似乎 search_field_x
和 search_value_x
选项用于此目的,但我无法让它们工作。
有没有人有关于如何指定这些参数的示例?我不太明白 docs here。也就是没看懂1-10这几个值代表什么。
这是我一直在使用的 curl
命令。我也使用他们的在线界面来提取数据,但结果始终是完整的提交集而不是我所追求的子集。
cstr='curl -i -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer secret_number" https://www.formstack.com/api/v2/form/form_id/submission.json?data=true\&page=1\&per_page=10\&search_field_x=School\&search_value_x="St.John" > my_data.json'
这是使用 Formstack API 取回过滤提交的方法:
卷曲:
curl -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer <bearer_number>" https://www.formstack.com/api/v2/form/<form_number>/submission.json?
data=true\&page=1\&per_page=100\&search_field_1=<my_search_field_number>\&search_value_1=<my_search_value>
或使用 python 并请求:
headers = {'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer <bearer_number>'
}
params = {'data': 'true',
'per_page': '100',
'search_field_1': '<my_search_field_number>',
'search_value_1': '<my_search_value>'
}
response = requests.get('https://www.formstack.com/api/v2/form/<my_form_id>/submission.json', headers=headers, params=params)
json_data = json.loads(response.text)
我正在尝试使用表单堆栈 API 将一些提交内容下载到我的计算机上。我可以下载所有提交,但我想下载字段等于某个值的记录(类似于在 SQL 中使用 where
)。
似乎 search_field_x
和 search_value_x
选项用于此目的,但我无法让它们工作。
有没有人有关于如何指定这些参数的示例?我不太明白 docs here。也就是没看懂1-10这几个值代表什么。
这是我一直在使用的 curl
命令。我也使用他们的在线界面来提取数据,但结果始终是完整的提交集而不是我所追求的子集。
cstr='curl -i -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer secret_number" https://www.formstack.com/api/v2/form/form_id/submission.json?data=true\&page=1\&per_page=10\&search_field_x=School\&search_value_x="St.John" > my_data.json'
这是使用 Formstack API 取回过滤提交的方法:
卷曲:
curl -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer <bearer_number>" https://www.formstack.com/api/v2/form/<form_number>/submission.json?
data=true\&page=1\&per_page=100\&search_field_1=<my_search_field_number>\&search_value_1=<my_search_value>
或使用 python 并请求:
headers = {'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer <bearer_number>'
}
params = {'data': 'true',
'per_page': '100',
'search_field_1': '<my_search_field_number>',
'search_value_1': '<my_search_value>'
}
response = requests.get('https://www.formstack.com/api/v2/form/<my_form_id>/submission.json', headers=headers, params=params)
json_data = json.loads(response.text)