← Back to team overview

dhis2-devs team mailing list archive

DHIS API

 

Hi,

I'm looking at the DHIS2 API and looking for a pointer to any documentation or email that has described it's usage. Apologize if the following is answered somewhere. If so, please direct me.

I'd like to try the /api/dataValueSets

Some questions:

- I can see that there used to be a function where the phone number of the org-unit could be set in the URL. It seems to have been removed again, perhaps for security purposes. But such a function would be useful for example when posting from SMS. Do you have tips on how to handle authentication from for example an SMS gateway?

- Is my POST being checked for authorization to see if I have rights to the particular orgUnit I'm posting to?

- Should the posting of the following XML to the above URL update the dataset values for January? Given that the IDs are correct of course. Would it be reporting for the orgUnit my logged-in user is associated with, or the orgUnit I'm stating?

<dataValueSet xmlns="http://dhis2.org/schema/dxf/2.0"; period="2012-01-01" dataSet="pBOMPrpg1QX" orgUnit="DiszpKrYNg8">
  <dataValue dataElement="f7n9E0hX8qk" value="1" />
  <dataValue dataElement="Vp12ncSU1Av" value="2" />
  <dataValue dataElement="LjNlMTl9Nq9" value="3" />
</dataValueSet>

Using CURL with the below command and above xml-file gives no error (200 OK), but I can't quite find the data in DHIS. I might have messaged up the ids of course.

curl -XPOST -H"Content-Type: application/xml" -umobile:district -v -d @datavalueset.xml "http://apps.dhis2.org/dev/api/dataValueSets";

Best regards,
Lars


Follow ups