[Dhis2-users] 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=pBOMPrpg1QXperiod=201201orgUnit=DiszpKrYNg8; -H Accept:application/xml -u admin:district -v -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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
Re: [Dhis2-users] Problem retrieving raw data
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 knu...@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? curl https://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QXperiod=201201orgUnit=DiszpKrYNg8; -H Accept:application/xml -u admin:district -v -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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
Re: [Dhis2-users] Problem retrieving raw data
OK weird, works on ubuntu without -k, maybe a windows issue. On Sun, Jul 13, 2014 at 1:44 PM, Lars Helge Øverland larshe...@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 knu...@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? curl https://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QXperiod=201201orgUnit=DiszpKrYNg8; -H Accept:application/xml -u admin:district -v -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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 ___ 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
Re: [Dhis2-users] Problem retrieving raw data
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=pBOMPrpg1QXperiod=201301orgUnit=DiszpKrYNg8 https://apps.dhis2.org/demo/api/dataValueSets.json?dataSet=pBOMPrpg1QXdataSet=BfMAe6ItzgtstartDate=2013-01-01endDate=2013-01-31orgUnit=YuQRtpLP10IorgUnit=vWbkYPRmKySchildren=true On Sun, Jul 13, 2014 at 1:44 PM, Lars Helge Øverland larshe...@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 knu...@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? curl https://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QXperiod=201201orgUnit=DiszpKrYNg8; -H Accept:application/xml -u admin:district -v -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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 -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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
[Dhis2-users] API shifted from HTML to XML?
Hi, When I browse the API in 2.16, I seem to get XM https://apps.dhis2.org/dev/api/resources instead of HTML, like it was in 2.15 https://apps.dhis2.org/demo/api/resources Is this intentional? -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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
Re: [Dhis2-users] API shifted from HTML to XML?
Or is there just a missing style file: This XML file does not appear to have any style information associated with it On Sun, Jul 13, 2014 at 2:42 PM, Knut Staring knu...@gmail.com wrote: Hi, When I browse the API in 2.16, I seem to get XM https://apps.dhis2.org/dev/api/resources instead of HTML, like it was in 2.15 https://apps.dhis2.org/demo/api/resources Is this intentional? -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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
Re: [Dhis2-users] Problem retrieving raw data
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 :-) On 13 July 2014 12:55, Knut Staring knu...@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=pBOMPrpg1QXperiod=201301orgUnit=DiszpKrYNg8 https://apps.dhis2.org/demo/api/dataValueSets.json?dataSet=pBOMPrpg1QXdataSet=BfMAe6ItzgtstartDate=2013-01-01endDate=2013-01-31orgUnit=YuQRtpLP10IorgUnit=vWbkYPRmKySchildren=true On Sun, Jul 13, 2014 at 1:44 PM, Lars Helge Øverland larshe...@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 knu...@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? curl https://apps.dhis2.org/demo/api/dataValueSets?dataSet=pBOMPrpg1QXperiod=201201orgUnit=DiszpKrYNg8; -H Accept:application/xml -u admin:district -v -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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 -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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 ___ 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
Re: [Dhis2-users] API shifted from HTML to XML?
Hi, yes its intentional. The HTML templates were static and too much hassle to keep in synch with the model. App idea: make an app that renders a nice, linked HTML-view for all resources based on the json resources. Lars On Sun, Jul 13, 2014 at 2:44 PM, Knut Staring knu...@gmail.com wrote: Or is there just a missing style file: This XML file does not appear to have any style information associated with it On Sun, Jul 13, 2014 at 2:42 PM, Knut Staring knu...@gmail.com wrote: Hi, When I browse the API in 2.16, I seem to get XM https://apps.dhis2.org/dev/api/resources instead of HTML, like it was in 2.15 https://apps.dhis2.org/demo/api/resources Is this intentional? -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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 ___ 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
Re: [Dhis2-users] API shifted from HTML to XML?
A shortcut to making an app would be if we exposed .json by default instead of XML: https://apps.dhis2.org/dev/api/resources.json has nicely clickable links if the user has something like JSONView installed: https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc Knut On Sun, Jul 13, 2014 at 8:18 PM, Lars Helge Øverland larshe...@gmail.com wrote: Hi, yes its intentional. The HTML templates were static and too much hassle to keep in synch with the model. App idea: make an app that renders a nice, linked HTML-view for all resources based on the json resources. Lars On Sun, Jul 13, 2014 at 2:44 PM, Knut Staring knu...@gmail.com wrote: Or is there just a missing style file: This XML file does not appear to have any style information associated with it On Sun, Jul 13, 2014 at 2:42 PM, Knut Staring knu...@gmail.com wrote: Hi, When I browse the API in 2.16, I seem to get XM https://apps.dhis2.org/dev/api/resources instead of HTML, like it was in 2.15 https://apps.dhis2.org/demo/api/resources Is this intentional? -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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 -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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
Re: [Dhis2-users] API shifted from HTML to XML?
Of course we could do that, but that would take away part of the restfulness of the API. I don't think we should change the way our links works, just because a plugin supports making http://* into real links. I understand that it is a bit harder to browse the API right now, but that should be fixed soon. We don't have to wait for 2.17 to be released for this, it could easily live as an external app, it shouldn't take long to develop something like that. -- Morten On Mon, Jul 14, 2014 at 11:06 AM, Knut Staring knu...@gmail.com wrote: So you can't just add .json to these links? On Mon, Jul 14, 2014 at 6:04 AM, Morten Olav Hansen morte...@gmail.com wrote: We do expose JSON as the default, if you send header Accept: */* that would return a JSON result. Problem is that the browser is usually sending something like Accept: text/html, application/xml, . so since it has no match for text/html, it will go to application/xml. We are hoping to provide an API browser app for 2.17. -- Morten On Mon, Jul 14, 2014 at 7:25 AM, Knut Staring knu...@gmail.com wrote: A shortcut to making an app would be if we exposed .json by default instead of XML: https://apps.dhis2.org/dev/api/resources.json has nicely clickable links if the user has something like JSONView installed: https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc Knut On Sun, Jul 13, 2014 at 8:18 PM, Lars Helge Øverland larshe...@gmail.com wrote: Hi, yes its intentional. The HTML templates were static and too much hassle to keep in synch with the model. App idea: make an app that renders a nice, linked HTML-view for all resources based on the json resources. Lars On Sun, Jul 13, 2014 at 2:44 PM, Knut Staring knu...@gmail.com wrote: Or is there just a missing style file: This XML file does not appear to have any style information associated with it On Sun, Jul 13, 2014 at 2:42 PM, Knut Staring knu...@gmail.com wrote: Hi, When I browse the API in 2.16, I seem to get XM https://apps.dhis2.org/dev/api/resources instead of HTML, like it was in 2.15 https://apps.dhis2.org/demo/api/resources Is this intentional? -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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 -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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 -- Knut Staring Dept. of Informatics, University of Oslo +4791880522 http://dhis2.org ___ 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