Skip to content

Commit

Permalink
Add documentation for formList endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankApiyo committed Nov 30, 2020
1 parent 1dcabba commit bd59b5a
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
60 changes: 60 additions & 0 deletions docs/formlist.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
FormList endpoints
*************************

Implements OpenRosa API |FormListAPI|

.. |FormListAPI| raw:: html

<a href="https://bitbucket.org/javarosa/javarosa/wiki/FormListAPI"
target="_blank">here</a>

Discovery Request
-----------------

.. raw:: html
<pre class="prettyprint">
<b>POST</b> /formList</pre>

Example
^^^^^^^
::

curl https://api.ona.io/formList

Here is an example response from the formlist endpoint
::

<xforms>
<xform>
<formID>form_id</formID>
<name>name</name>
<version>202006121145</version>
<hash>md5:965fad0dbad4bb708d18abe77fcfe358</hash>
<descriptionText/>
<downloadUrl>https://api.ona.io/username/forms/pk/form.xml</downloadUrl>
</xform>
<xform>
<formID>testerform</formID>
<name>testerform</name>
<version>201904231241</version>
<hash>md5:a023b3535b7b593de1e9ad075e9e21e6</hash>
<descriptionText/>
<downloadUrl>https://api.ona.io/username/forms/pk/form.xml</downloadUrl>
<manifestUrl>https://api.ona.io/username/xformsManifest/1620</manifestUrl>
</xform>
</xforms>



Get a single form using form's pk
---------------------------------

You can get a single form by specifying the form's `pk` in the following ways:
Example
^^^^^^^
::

curl https://stage-api.ona.io/enketo/<form_pk>/formList
curl https://stage-api.ona.io/enketo-preview/<form_pk>/formList
curl https://stage-api.ona.io/<user_name>/<form_pk>/formList

3 changes: 1 addition & 2 deletions docs/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ Set Form Information
--------------------

You can use ``PUT`` or ``PATCH`` http methods to update or set form data elements.
If you are using ``PUT``, you have to provide the `uuid, description,
downloadable, owner, public, public_data, title` fields. With ``PATCH`` you only need to provide at least one of the fields.
If you are using ``PUT``, you have to provide the `uuid, description, downloadable, owner, public, public_data, title` fields. With ``PATCH`` you only need to provide at least one of the fields.

Replacing a Form
----------------
Expand Down

0 comments on commit bd59b5a

Please sign in to comment.