← Back to team overview

dhis2-devs team mailing list archive

Re: Metadata filtering in API no longer working?

 

Yes, I think we should try to add these kind of helpful tips to the manual.
The Web API is quite extensively covered, but there is still some leap to
get started with apps for those of us who are not experienced API + JS
developers...


On Wed, Jun 11, 2014 at 9:09 AM, Farai Mutero <fmutero@xxxxxxxxx> wrote:

> Thanks Knut for raising this question. Now I no longer have to hard code
> the root OU UID so as to render the full OU hierarchy in my apps.
>
>
> On Wed, Jun 11, 2014 at 9:07 AM, Knut Staring <knutst@xxxxxxxxx> wrote:
>
>> Thanks!
>>
>> I now did this, which also works:
>>
>>   var url = dhis_api_base
>> +'organisationUnits.json?userDataViewFallback=true';
>>   $.getJSON( url, function( json ) {
>>  console.dir(json.organisationUnits[0].name + ' has UID ' +
>> json.organisationUnits[0].id);
>>   });
>>
>>
>> On Wed, Jun 11, 2014 at 9:03 AM, Morten Olav Hansen <mortenoh@xxxxxxxxx>
>> wrote:
>>
>>>
>>> On Wed, Jun 11, 2014 at 8:50 AM, Knut Staring <knutst@xxxxxxxxx> wrote:
>>>
>>>>   $.getJSON( url, function( json ) {
>>>> console.dir(json);
>>>>   });
>>>>
>>>
>>> $.ajax({
>>>   url: URL,
>>>   dataType: 'json'
>>> }).done(function(data) {
>>>   $.each(data.organisationUnits, function(idx) {
>>>     console.log("root" + idx + ": " + this.id);
>>>   })
>>> });
>>>
>>> Something like that could work, it returns an array of orgUnits
>>>
>>> --
>>> Morten
>>>
>>
>>
>>
>> --
>> Knut Staring
>> Dept. of Informatics, University of Oslo
>> +4791880522
>> http://dhis2.org
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Farai Mutero
>
>


-- 
Knut Staring
Dept. of Informatics, University of Oslo
+4791880522
http://dhis2.org

References