How to upload configurable forms using the API

This guide will provide step by step guidance on how to post configurable forms to the OpenSRP API using Postman REST client.

  1. Import the Postman environment. Detailed examples on how to do the import can be found here .A sample Postman environment file for Reveal is found below. Edit the template and add actual url, username and password values for your server.

 

2. Import the Postman collection that contains endpoints for interacting with the form and manifest APIs. A sample postman collection for Reveal is found below.

3. Make a call to the rest/manifest endpoint to get the latest manifest with the latest forms_version.

4. Upload the form with the changes by making a POST request to the /opensrp/rest/clientForm/ endpoint. The version for the form being uploaded should be higher than the forms_version of the latest manifest. The screenshot below shows how to upload a blood screening form

Relevance and calculation rules can be uploaded using the same endpoint

 

The forms can be found on the project’s github repository e.g Reveal forms can be found here while the relevance and calculation rules can be found here

5. After all the files with updates are uploaded, make a POST request to the rest/manifest endpoint. The manifest payload will contain the incremented forms_version

6. After the updated forms and manifest have been uploaded to the server, wait for the changes to be synced down to the client. A service periodically runs on the client that fetches the updates. The sync interval is set on the client an example is every 15 minutes.

7 After the changes are synced to the client. It should be possible to view the changes once the form is opened.