-
Notifications
You must be signed in to change notification settings - Fork 163
Formhub Access Points (API)
formhub.org offers various access points to the form and data stored on formhub. Most of the access points refer to a user name and a form name, which I will denote as USERNAME and FORMNAME below:
(All access points use HTTP GET unless otherwise specified):
XLS, XML and JSON forms:
https://formhub.org/USERNAME/forms/FORMNAME/form.FILETYPE
where FILETYPE can be xml, xls or json
JSONP form:
https://formhub.org/USERNAME/forms/FORMNAME/form.json&callback=CALLBACKFN
The xls and csv are more or less raw data outputs, where all the fields correspond to the "name"s specified in the xls form.
https://formhub.org/USERNAME/forms/FORMNAME/data.FILETYPE
where FILETYPE is xls or csv.
Xls data outputs have:
- repeats broken out to a separate sheet
- (currently) groups broken out to a separate sheet each
Csv data outputs have:
- All data in one big sheet
- GPS points broken out. If the name of a geopoint field is
geopoint_field
, four additional data fields namegeopoint_field_latitude
geopoint_field_longitude
geopoint_field_precision
andgeopoint_field_altitude
will be present in the sheet. - Repeats in the same sheet, (currently) upto four repeat elements are output. Each repeat element has a suffix after the name: [1], [2], [3], [4], etc.
The kml output can be fed into google earth, and gives a view very similar to the map view on formhub--the question names are replaced by the text of the question.
https://formhub.org/USERNAME/forms/FORMNAME/data.kml
start
and end
date must be formatted as YY_MM_DD_hh_mm_ss, both are optional and will filter inclusively. The below query returns results from January 1st 2011 at 00:00 and 00 seconds until December 31st at 23:59 and 59 seconds.
https://formhub.org/USERNAME/forms/FORMNAME/form.FILETYPE?start=11_01_01_00_00_00&end=11_12_31_23_59_59
A request like
https://formhub.org/USERNAME/forms/FORMNAME/data.kml
will usually result in a redirect, and the downloaded filename will have the current date attached to it (which helps you track when you downloaded submissions last). However, for programmatic purposes, if you want the raw file, and no redirects, you can add a raw=1
to the URL parameter list, like:
https://formhub.org/USERNAME/forms/FORMNAME/data.kml?raw=1