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&quot; 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 "DHIS2 App Hub;

Best regards,
Lars

Hi Lars

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.

We will write up something soon. But it is just a matter of following
the description at /api/dataValueSets . The ids can be found by
browsing the API from the /api/resources endpoint.

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?

Yes we removed it because the implementation was fuzzy and because
Long told us it was not in use. I don't know much about SMS gateways
but we can of course try to come up with a solution if you provide the
requirements.

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

No not at the moment but we will implement it.

- 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&quot; period="2012-01-01"
dataSet="pBOMPrpg1QX" orgUnit="DiszpKrYNg8">
<dataValue dataElement="f7n9E0hX8qk" value="1" />
<dataValue dataElement="Vp12ncSU1Av" value="2" />
<dataValue dataElement="LjNlMTl9Nq9" value="3" />
</dataValueSet>

It is correct. Except if the period is supposed to be a month it
should be 201201 according to the current format. It will use the org
unit supplied in the xml message.

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.

Try to change the period and then look for the data in the data entry
module, using the right period, data set, org unit.

Will get back with more info later....

Lars

···

On Fri, Mar 16, 2012 at 1:53 PM, Lars Kristian Roland <lars@roland.bz> wrote:

Could you also describe how to delete existing values through the api?

···

Sent from my mobile

On Mar 17, 2012 7:46 PM, “Lars Helge Øverland” larshelge@gmail.com wrote:

Hi Lars

On Fri, Mar 16, 2012 at 1:53 PM, Lars Kristian Roland lars@roland.bz wrote:

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.

We will write up something soon. But it is just a matter of following

the description at /api/dataValueSets . The ids can be found by

browsing the API from the /api/resources endpoint.

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?

Yes we removed it because the implementation was fuzzy and because

Long told us it was not in use. I don’t know much about SMS gateways

but we can of course try to come up with a solution if you provide the

requirements.

  • Is my POST being checked for authorization to see if I have rights to the

particular orgUnit I’m posting to?

No not at the moment but we will implement it.

  • 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”>

It is correct. Except if the period is supposed to be a month it

should be 201201 according to the current format. It will use the org

unit supplied in the xml message.

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.

Try to change the period and then look for the data in the data entry

module, using the right period, data set, org unit.

Will get back with more info later…

Lars


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Not possible at the moment I'm afraid, definitely should be done, will
fix for 2.8.

Lars: I have improved the description at /api/dataValueSets with some
more info on the period formats.

···

2012/3/17 Jason Pickering <jason.p.pickering@gmail.com>:

Could you also describe how to delete existing values through the api?

Thanks,

good stuff. This API will really open up for some great possibilities.

Lars

···

On 17.03.2012 19:38, Lars Helge �verland wrote:

2012/3/17 Jason Pickering<jason.p.pickering@gmail.com>:

Could you also describe how to delete existing values through the api?

Not possible at the moment I'm afraid, definitely should be done, will
fix for 2.8.

Lars: I have improved the description at /api/dataValueSets with some
more info on the period formats.

--
Lars Kristian Roland
Lars@roland.bz
+47 90733036
www.apus.no - lars.roland.bz

It seems not to be possible to delete data values through the user interface either.

···

Sent from my mobile

On Mar 17, 2012 8:38 PM, “Lars Helge Øverland” larshelge@gmail.com wrote:

2012/3/17 Jason Pickering jason.p.pickering@gmail.com:

Could you also describe how to delete existing values through the api?

Not possible at the moment I’m afraid, definitely should be done, will

fix for 2.8.

Lars: I have improved the description at /api/dataValueSets with some

more info on the period formats.

It seems not to be possible to delete data values through the user interface either.

You must use backspace and move to next cell in data entry module.

···

On Mar 17, 2012 7:53 PM, “Jason Pickering” jason.p.pickering@gmail.com wrote:

Sent from my mobile

On Mar 17, 2012 8:38 PM, “Lars Helge Øverland” larshelge@gmail.com wrote:

2012/3/17 Jason Pickering jason.p.pickering@gmail.com:

Could you also describe how to delete existing values through the api?

Not possible at the moment I’m afraid, definitely should be done, will

fix for 2.8.

Lars: I have improved the description at /api/dataValueSets with some

more info on the period formats.

Couldn't agree more.
Keep up the good job with the api and keep improving it, guys.
We look forward to the web-api in 2.8... would be very useful for integration with mobile back-ends.

Ime

···

--- On Sat, 3/17/12, Lars Kristian Roland <lars@roland.bz> wrote:

From: Lars Kristian Roland <lars@roland.bz>
Subject: Re: [Dhis2-devs] DHIS API
To: "Lars Helge Øverland" <larshelge@gmail.com>
Cc: dhis2-devs@lists.launchpad.net
Date: Saturday, March 17, 2012, 7:49 PM
Thanks,

good stuff. This API will really open up for some great
possibilities.

Lars

On 17.03.2012 19:38, Lars Helge Øverland wrote:
> 2012/3/17 Jason Pickering<jason.p.pickering@gmail.com>:
>> Could you also describe how to delete existing
values through the api?
>>
> Not possible at the moment I'm afraid, definitely
should be done, will
> fix for 2.8.
>
>
> Lars: I have improved the description at
/api/dataValueSets with some
> more info on the period formats.

--
Lars Kristian Roland
Lars@roland.bz
+47 90733036
www.apus.no - lars.roland.bz

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help