=== modified file 'src/docbkx/en/dhis2_user_man_web_api.xml' --- src/docbkx/en/dhis2_user_man_web_api.xml 2013-05-20 06:12:56 +0000 +++ src/docbkx/en/dhis2_user_man_web_api.xml 2013-05-20 14:49:21 +0000 @@ -478,7 +478,9 @@ It is assumed that we have posted data values to DHIS according to the previous section called "Sending data values". We can now put together our request and send it using cURL: - curl "http://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QX&period=201201&orgUnit=DiszpKrYNg8" -H "Accept:application/xml" -u admin:district -v + curl + "http://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QX&period=201201&orgUnit=DiszpKrYNg8" + -H "Accept:application/xml" -u admin:district -v The response will look something like this: HTTP/1.1 200 OK Content-Type: application/xml @@ -496,6 +498,53 @@ 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.
+ Reading large bulks of data values + This section explains how to retrieve large bulks of data values which not necessarily + belong in a single data value set. We will, like in the previous section, interact with the + dataValueSets resource. The query parameters to use are these: + + Data value set query parameters + + + + + + Parameter + Description + + + + + dataSet + Data set identifier, can be specified multiple times + + + startDate + Start date for the time span of the values to export + + + endDate + End date for the time span of the values to export + + + orgUnit + Organisation unit identifier, can be specified multiple times + + + children + Whether to include the children in the hierarchy of the organisation + units + + + +
+ The dataSet and orgUnit parameters can be repeated in order to include multiple data sets + and organisation units. An example request looks like this: + curl + "http://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true" + -H "Accept:application/xml" -u admin:district -v +
+
Writing and reading messages DHIS 2 features a mechanism for sending messages for purposes such as user feedback, notifications and general information to users. Messages are delivered to the DHIS 2 message inbox but can also be sent to the user's email addresses and mobile phones as SMS. In this example we will see how we can utilize the Web API to send and read messages. We will pretend to be the DHIS Administrator user and send a message to the Mobile user. We will then pretend to be the mobile user and read our new message. The resource we need to interact with when sending and reading messages is the messageConversations resource. We start by visiting the Web API entry point at where we find and follow the link to the messageConversations resource at . The description tells us that we can use a POST request to create a new message using the following XML format: