← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-documenters/dhis2/dhis2-docbook-docs] Rev 671: Added blurb and examples about the FRED API

 

------------------------------------------------------------
revno: 671
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2-docbook-docs
timestamp: Fri 2013-03-08 10:05:21 +0300
message:
  Added blurb and examples about the FRED API
modified:
  src/docbkx/en/dhis2_user_man_web_api.xml


--
lp:~dhis2-documenters/dhis2/dhis2-docbook-docs
https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs

Your team DHIS 2 developers is subscribed to branch lp:~dhis2-documenters/dhis2/dhis2-docbook-docs.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs/+edit-subscription
=== modified file 'src/docbkx/en/dhis2_user_man_web_api.xml'
--- src/docbkx/en/dhis2_user_man_web_api.xml	2013-03-07 10:13:27 +0000
+++ src/docbkx/en/dhis2_user_man_web_api.xml	2013-03-08 07:05:21 +0000
@@ -1458,4 +1458,36 @@
     <screen>http://&lt;server-url>/api/resourceTables/dataMart</screen>
     <para>These requests will return immediately and initiate a server-side process.</para>
   </section>
+  <section>
+    <title>FRED API v1.0</title>
+    <para>In addition to our own web-api, DHIS 2 (from 2.11) includes support for the current draft
+      of FRED API v1.0. The project defines itself as <quote>open standard for sharing and updating
+        health facility data.</quote>, and the specification can be found at <ulink
+        url="http://facilityregistry.org/";>http://facilityregistry.org/</ulink>.</para>
+    <para>Since v1.0 is not finalized, there are parts of the current specification that has not
+      been implemented (parts we found to not be in a stable enough state). Most notable we do not
+      currently support sorting (we do however sort on name by default), and filtering facilities, </para>
+    <para>The entry point for the implementation can be found at http://&lt;server-url>/api-fred,
+      and the current version is located at http://&lt;server-url>/api-fred/v1, the UI should be
+      considered <emphasis role="bold">beta</emphasis> quality at this point, and will be polished
+      in 2.12.</para>
+    <section>
+      <title>Example usage</title>
+      <para>This section will give some simple examples of using the API.</para>
+      <para>
+        <emphasis>Get all facilities:</emphasis>
+        <screen>curl -u username:password -X GET http://&lt;server-url>/api-fred/v1/facilities.json</screen>
+        <emphasis>Get a specific facility based on either UID or UUID:</emphasis><screen>curl -u username:password -X GET http://&lt;server-url>/api-fred/v1/facilities/UID.json
+curl -u username:password -X GET http://&lt;server-url>/api-fred/v1/facilities/UUID.json</screen>
+        <emphasis>Create a new facility:</emphasis><screen>curl -u username:password -X POST -d @new_facility.json
+  -H "Content-Type: application/json" http://&lt;server-url>/api-fred/v1/facilities.json</screen>
+        <emphasis>Update a
+        facility:</emphasis><screen>curl -u username:password -X POST -d @updated_facility.json
+  -H "Content-Type: application/json" http://&lt;server-url>/api-fred/v1/facilities/UID.json
+
+curl -u username:password -X POST -d @updated_facility.json
+  -H "Content-Type: application/json" http://&lt;server-url>/api-fred/v1/facilities/UUID.json</screen>
+      </para>
+    </section>
+  </section>
 </chapter>