Problem retrieving raw data

Hi,
I’m trying to retrieve some raw data through the API (not going via Analytics).

This is described in the manual: https://www.dhis2.org/doc/snapshot/en/user/html/ch31s09.html#d5e8089

But I cannot get the following to work - have things changed?

curl “https://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QX&period=201201&orgUnit=DiszpKrYNg8” -H “Accept:application/xml” -u admin:district -v

···


Knut Staring

Dept. of Informatics, University of Oslo

+4791880522

http://dhis2.org

Ok, it works if I bypass the certificate checking by adding " -k" to the end.

Knut

···

On Sun, Jul 13, 2014 at 1:38 PM, Knut Staring knutst@gmail.com wrote:

Hi,
I’m trying to retrieve some raw data through the API (not going via Analytics).

This is described in the manual: https://www.dhis2.org/doc/snapshot/en/user/html/ch31s09.html#d5e8089

But I cannot get the following to work - have things changed?

Knut Staring

Dept. of Informatics, University of Oslo

+4791880522

http://dhis2.org

curl “https://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QX&period=201201&orgUnit=DiszpKrYNg8” -H “Accept:application/xml” -u admin:district -v


Knut Staring

Dept. of Informatics, University of Oslo

+4791880522

http://dhis2.org

Hi,

it works, there is just no data for that combination.

regards,

Lars

···

On Sun, Jul 13, 2014 at 1:38 PM, Knut Staring knutst@gmail.com wrote:

Hi,
I’m trying to retrieve some raw data through the API (not going via Analytics).

This is described in the manual: https://www.dhis2.org/doc/snapshot/en/user/html/ch31s09.html#d5e8089

But I cannot get the following to work - have things changed?

Knut Staring

Dept. of Informatics, University of Oslo

+4791880522

http://dhis2.org

curl “https://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QX&period=201201&orgUnit=DiszpKrYNg8” -H “Accept:application/xml” -u admin:district -v


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

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

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

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

OK weird, works on ubuntu without -k, maybe a windows issue.

···

On Sun, Jul 13, 2014 at 1:44 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi,

it works, there is just no data for that combination.

regards,

Lars

On Sun, Jul 13, 2014 at 1:38 PM, Knut Staring knutst@gmail.com wrote:

Hi,
I’m trying to retrieve some raw data through the API (not going via Analytics).

This is described in the manual: https://www.dhis2.org/doc/snapshot/en/user/html/ch31s09.html#d5e8089

But I cannot get the following to work - have things changed?

Knut Staring

Dept. of Informatics, University of Oslo

+4791880522

http://dhis2.org

curl “https://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QX&period=201201&orgUnit=DiszpKrYNg8” -H “Accept:application/xml” -u admin:district -v


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

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

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

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

Yes, probably. I used curl as installed with the usually excellent Gow tool for Windows:
https://github.com/bmatzelle/gow

We should probably change 2012 to 2013 in the manual (and then 2014 in a few months…)

Also, some may find it more intuitive to have a look in directly in the browser first by adding .json:
https://apps.dhis2.org/demo/api/dataValueSets.json?dataSet=pBOMPrpg1QX&period=201301&orgUnit=DiszpKrYNg8

https://apps.dhis2.org/demo/api/dataValueSets.json?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true

···

On Sun, Jul 13, 2014 at 1:44 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi,

it works, there is just no data for that combination.

regards,

Lars


Knut Staring

Dept. of Informatics, University of Oslo

+4791880522

http://dhis2.org

On Sun, Jul 13, 2014 at 1:38 PM, Knut Staring knutst@gmail.com wrote:

Hi,
I’m trying to retrieve some raw data through the API (not going via Analytics).

This is described in the manual: https://www.dhis2.org/doc/snapshot/en/user/html/ch31s09.html#d5e8089

But I cannot get the following to work - have things changed?

Knut Staring

Dept. of Informatics, University of Oslo

+4791880522

http://dhis2.org

curl “https://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QX&period=201201&orgUnit=DiszpKrYNg8” -H “Accept:application/xml” -u admin:district -v


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

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

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

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

Hi Knut

I see the gow tools are distributed as simple binary exe files. Also they are “windows native” so probably compiled against the windows ssl libraries rather than openssl lib. From the curl docs here http://curl.haxx.se/docs/sslcerts.html I am sure your curl simply doesn’t have access to any ca certs to validate host certificates against.

···

You’ll know for sure if you have similar error accessing any other https sites. meanwhile I guess ‘-k’ is your friend :slight_smile:

On 13 July 2014 12:55, Knut Staring knutst@gmail.com wrote:

Yes, probably. I used curl as installed with the usually excellent Gow tool for Windows:
https://github.com/bmatzelle/gow

We should probably change 2012 to 2013 in the manual (and then 2014 in a few months…)

Also, some may find it more intuitive to have a look in directly in the browser first by adding .json:
https://apps.dhis2.org/demo/api/dataValueSets.json?dataSet=pBOMPrpg1QX&period=201301&orgUnit=DiszpKrYNg8

https://apps.dhis2.org/demo/api/dataValueSets.json?dataSet=pBOMPrpg1QX&dataSet=BfMAe6Itzgt&startDate=2013-01-01&endDate=2013-01-31&orgUnit=YuQRtpLP10I&orgUnit=vWbkYPRmKyS&children=true


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

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

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

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

On Sun, Jul 13, 2014 at 1:44 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi,

it works, there is just no data for that combination.

regards,

Lars


Knut Staring

Dept. of Informatics, University of Oslo

+4791880522

http://dhis2.org

On Sun, Jul 13, 2014 at 1:38 PM, Knut Staring knutst@gmail.com wrote:

Hi,
I’m trying to retrieve some raw data through the API (not going via Analytics).

This is described in the manual: https://www.dhis2.org/doc/snapshot/en/user/html/ch31s09.html#d5e8089

But I cannot get the following to work - have things changed?

Knut Staring

Dept. of Informatics, University of Oslo

+4791880522

http://dhis2.org

curl “https://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QX&period=201201&orgUnit=DiszpKrYNg8” -H “Accept:application/xml” -u admin:district -v


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

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

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

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