=== modified file 'src/docbkx/en/dhis2_user_man_web_api.xml' --- src/docbkx/en/dhis2_user_man_web_api.xml 2012-07-31 10:14:22 +0000 +++ src/docbkx/en/dhis2_user_man_web_api.xml 2012-08-01 08:40:24 +0000 @@ -109,6 +109,102 @@
+ Working with the meta-data API + With the release of 2.9, a special entry point for meta-data was added in the API, this + can be accessed through /api/metaData. This section will give + a basic introduction to working with this API, for specific synchronization issues, please see + INTEGRATION_CHAPTER. + By default, talking to /api/metaData will give you + everything, rendered as XML. But just as we can define what we want in the general API, we can + also do that with /api/metaData. + + + Available Content-Types + + + + + + Content-Type + Description + + + + + application/xml + Returns the meta-data in XML representation + + + application/json + Returns the meta-data in JSON representation + + + +
+
+ + + Available Query Filters + + + + + + + Option + Values + Description + + + + + assumeTrue + true/false (default true) + If you don't want everything that /api/metaData gives you by default, when set to false, this option + will not return anything by default. You have to enable the resources you want + yourself (see below). + + + {resources} + true/false (default depending on assumeTrue) + Please see /api for available resources. This + option will allow you to override the default (which is taken from assumeTrue) and + further refine what meta-data you want. + + + lastUpdated + Three date formats are supported: + + YEAR + + + MONTH/YEAR + + + DAY/MONTH/YEAR + + + + Filters the meta-data based on the lastUpdated field, this allows you to + synchronize meta-data as a nightly job, without downloading everything from the + server. + + + +
+
+
+
+ Example: Get a filtered set of meta-data + As described in the last section, there is a number of options you can apply to /api/metaData to give you a filtered view. The use-case we will be + looking into here, is the case where you want a nightly job that synchronizes organisation + units. We will be using cURL as the HTTP + client.curl -H "Accept: application/xml" -u user:pass + {HOST}/api/metaData?assumeTrue=false&organisationUnits=true&lastUpdated=01/08/2012 +
+
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: