我正在尝试使用表单Stack下载一些提交到我的计算机上。我可以下载所有提交文件,但是我想下载字段等于某个值的记录(类似于在SQL中使用where )。
search_field_x和search_value_x选项似乎就是为此目的而使用的,但我无法让它们发挥作用。
有人有关于如何指定这些参数的示例吗?我不太明白医生来了的意思。也就是说,我不明白值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'发布于 2018-12-14 14:49:26
下面是使用Formstack获取过滤提交的一种方法:
卷曲:
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)https://stackoverflow.com/questions/53378605
复制相似问题