(for Developers and Software Integrations)
XForms uses RESTful APIs to communicate between its mobile apps, reporting and admin web app, and other external systems.
***NOTE*** Our documentation is a work in progress and will be updated and improved regularly as the platform matures.
Example Use Case
With the XForms APIs, you could—for example—use XForms solely for field data capture, and then extract that data out of XForms for insertion into your existing enterprise reporting dashboard software. This is a perfectly normal use case for XForms.
Here’s what you would do to make this work
- Build your forms using the XForms Designer. If these forms use listboxes with reference values, then you would also build reference lists in XForms
- Populate and update the reference lists in XForms programmatically
- Extract saved forms programmatically. You can even extract images (including the draw layer), signatures, tables, and PDF versions of the saved forms.
How to Update a Reference-List
To update any type of document, such as Form, Template, and Reference-List, you must follow the following 3 steps:
- Authenticate and obtain the Access-Token
- Get Reference-list ID (if not available)
- Read the reference-list
- Write the update reference-list
Before calling any endpoint in XForms API, you would need to obtain an access token. Then the Access-Token needs to be sent along with any other requests.
Get Reference-List’s ID
The reference-list can be downloaded using its ID. If the ID not available, we can get a list of existing reference-lists with their IDs first
Get Reference-List by ID
If the reference-list ID is available, the full document can be retrieved by calling the get by ID endpoint
The updated reference-list can be uploaded to the server by calling the Put endpoint.
Please note that only the “items” part of the reference-list can be updated. Changing name or ID might break the link of the reference list to the forms.
How to Retrieve Forms Data
Retrieving forms data is similar to retrieving reference-lists. You just need to specify the “userForm” as type. Here are the steps:
- Authenticate and obtain the Access-Token (if you haven’t done so). Similar to what is described for Reference-Lists.
- Get Forms IDs
- Get the full form by ID
Get Forms IDs
Form data can be downloaded using its ID. The ID’s can be obtained by getting a list of forms and IDs first.
Get Form Data by ID
Using the Form ID, the form details can be retrieved, as below.