dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #29528
[Branch ~dhis2-documenters/dhis2/dhis2-docbook-docs] Rev 1035: docs for json output format
------------------------------------------------------------
revno: 1035
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2-docbook-docs
timestamp: Tue 2014-04-22 19:08:55 +0545
message:
docs for json output format
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-04-22 12:45:52 +0000
+++ src/docbkx/en/dhis2_user_man_web_api.xml 2014-04-22 13:23:55 +0000
@@ -799,6 +799,23 @@
categoryOptionCombo="bRowv6yZOF2" value="10001"/>
</dataValueSet></screen>
<para>The header tells us that the request was processed successfully and that we are receiving a response in XML format. The XML message looks familiar - it is the data values we sent in the previous section.</para>
+ <para>You can also request the same data with a JSON
+ payload:<screen>curl "http://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QX&period=201201&orgUnit=DiszpKrYNg8" -H "Accept:application/json" -u admin:district -v</screen></para>
+ <para>The response will look something like
+ this:<screen>{
+ "dataSet": "pBOMPrpg1QX",
+ "completeData": "2012-02-03",
+ "period": "201201",
+ "orgUnit": "DiszpKrYNg8",
+ "dataValues": [
+ { "dataElement": "eY5ehpbEsB7", "categoryOptionCombo": "bRowv6yZOF2", "period": "201201",
+ "orgUnit": "DiszpKrYNg8", "value": "10003" },
+ { "dataElement": "Ix2HsbDMLea", "categoryOptionCombo": "bRowv6yZOF2", "period": "201201",
+ "orgUnit": "DiszpKrYNg8", "value": "10002" },
+ { "dataElement": "f7n9E0hX8qk", "categoryOptionCombo": "bRowv6yZOF2", "period": "201201",
+ "orgUnit": "DiszpKrYNg8", "value": "10001" }
+ ]
+}</screen></para>
</section>
<section>
<title>Reading large bulks of data values</title>