← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-documenters/dhis2/dhis2-docbook-docs] Rev 1110: Web api, system settings update

 

------------------------------------------------------------
revno: 1110
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2-docbook-docs
timestamp: Tue 2014-06-24 21:25:41 +0200
message:
  Web api, system settings update
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	2014-06-16 20:02:18 +0000
+++ src/docbkx/en/dhis2_user_man_web_api.xml	2014-06-24 19:25:41 +0000
@@ -4374,10 +4374,24 @@
     <para>Alternatively, you can submit the setting value as the request body, where content type is
       set to "text/plain". As an example, you can use curl like this:</para>
     <screen>curl "apps.dhis2.org/demo/api/systemSettings/my-key" -d "My long value" -H "Content-Type: text/plain" -u admin:district -v</screen>
+    <para>To set system settings in bulk you can send a JSON object with a property -value pair for
+      each system setting key-value pair using a POST request:</para>
+    <screen>{
+  "keyApplicationNotification": "Welcome",
+  "keyApplicationIntro": "DHIS 2",
+  "keyApplicationFooter": "Read more at dhis2.org"
+}  </screen>
     <para>You should replace my-key with your real key and my-val with your real value. To retrieve
       the value for a given key in plain text you can make a <emphasis role="italic">GET</emphasis>
       request to the following URL:</para>
     <screen>/api/systemSettings/my-key</screen>
+    <para>Alternatively, you can specify the key as a query parameter:</para>
+    <screen>/api/systemSettings?key=my-key</screen>
+    <para>You can retrieve specific system settings as JSON by repeating the key query
+      parameter:</para>
+    <screen>curl "apps.dhis2.org/demo/api/systemSettings?key=keyApplicationNotification&amp;key=keyApplicationIntro" -H "Content-Type: application/json" -u admin:district -v</screen>
+    <para>You can retrieve all system settings with a GET request:</para>
+    <screen>/api/systemSettings</screen>
     <para>To delete a system setting, you can make a <emphasis role="italic">DELETE</emphasis>
       request to the URL similar to the one used above for retrieval.</para>
   </section>