=== modified file 'src/docbkx/en/dhis2_user_man_web_api.xml' --- src/docbkx/en/dhis2_user_man_web_api.xml 2012-04-29 09:33:31 +0000 +++ src/docbkx/en/dhis2_user_man_web_api.xml 2012-05-01 09:18:56 +0000 @@ -28,6 +28,70 @@ Basic authenication was chosen for the DHIS 2 Web API because it is simple and straight-forward to use and has wide support in development frameworks.
+ Date and period format + Throughout the Web API we refer to dates and periods. The date format is: + yyyy-MM-dd + For instance, if you want to express March 20, 2012 you must use 2012-03-20. + The period format is described in the following table. + + Period format + + + + + Interval + + + Format + + + Example + + + Description + + + + Day + yyyyMMdd + 20040315 + March 15 2004 + + + Week + yyyyWn + 2004W10 + Week 10 2004 + + + Month + yyyyMM + 200403 + March 2004 + + + Quarter + yyyyQn + 2004Q1 + January-March 2004 + + + Six-month + yyyySn + 2004S1 + Janary-June 2004 + + + Year + yyyy + 2004 + 2004 + + + +
+
+
Example: Sending data values A common use-case for system integration is the need to send a set of data values from a third-party system into DHIS. In this example we will use the DHIS 2 demo on as basis and we recommend that you follow the provided links with a web browser while reading (log in with admin/district as username/password). We assume that we have collected case-based data using a simple software client running on mobile phones for the Mortality <5 years data set in the community of Ngelehun CHC (in Badjia chiedom, Bo district) for the month of January 2012. We have now aggregated our data into a statistical report and want to send that data to the national DHIS 2 instance. The entry point for the Web API running on the demo instance is . The entry point provides a convenient HTML page with links to all of the available resources in the Web API. The resource which is most appropriate for our purpose of sending data values is the dataValueSets resource. A data value set represents a set of data values which have a logical relationship, usually from being captured off the same data entry form. We follow the link to the HTML representation which will take us to . The default representation is a HTML page which provides us with useful instructions on how to interact with this resources. It tells us that we can use the POST verb to send values using a XML format defined by the http://dhis2.org/schema/dxf/2.0 namespace: