← Back to team overview

dhis2-devs team mailing list archive

Re: OrgUnit API

 

You mean children, or descendants? if you just want the full view of the
children of a few OUs you could probably get away with

?fields[:all,children[:all]] ?

--
Morten


On Fri, Sep 5, 2014 at 12:18 PM, Mahendra Kariya <
mahendra.kariya@xxxxxxxxxxxxxxxx> wrote:

> OK.
>
> So we need all fields for an org unit, but we don't need all org units. We
> only need a few org units with all fields and all its children
> (recursively).
>
> I tried GETting this information with the URL
> http://localhost:8080/api/organisationUnits.json?fields=[:all]&includeChildren=true&filter=id:eq:a42405657c4&filter=id:eq:ade053ef050&paging=false
>
>
> But the response doesn't have all children recursively. Can we use
> includeChildren=true param on /api/organisationUnits or it only works on
> /api/organisationUnits/{id}? If this param is not supported on
> /api/organisationUnits, is there some other work around?
>
>
>
>
> On Fri, Sep 5, 2014 at 10:42 AM, Morten Olav Hansen <mortenoh@xxxxxxxxx>
> wrote:
>
>>
>> On Fri, Sep 5, 2014 at 11:55 AM, Mahendra Kariya <
>> mahendra.kariya@xxxxxxxxxxxxxxxx> wrote:
>>
>>> It looks like attributeValues field takes most of the time. We have
>>> around 6-7 custom attributes for each orgUnit. We don't need all of these.
>>> We only need the value of one particular attribute. Is there a way to do
>>> this?
>>>
>>
>> Hm, no. We only allow filtering for a specific value, but I guess you
>> don't really know the values here. Its more difficult to filter inside a
>> collection, not sure how the API would look for that.
>>
>> We might want to support something like that in the future, but its
>> definitely not supported today.
>>
>> The best solution here would be to use http gzip if you don't already use
>> it. You could also get the data from
>> /api/metadata.gz?assumeTrue=false&organisationUnits=true but that probably
>> won't work as expected in a browser setting, unless you use some kind of JS
>> gunzip.
>>
>> --
>> Morten
>>
>
>

References