← Back to team overview

dhis2-devs team mailing list archive

Re: Web API - Search by id

 

Perhaps then we are not looking for a rest api call which will return the
resource.  But rather a relatively simple uid lookup/translation

Two use cases that we know of are find-uid-by-code and
find-uid-by-internal-identifier.

Saptarshi has explained why he needs the latter.  Looking up uid by code is
required because there are many cases where data needs to be matched
between systems using codes.  This is why we have the possibility of using
idScheme='code' on data import.  But there are some cases where it is still
necessary to use the uid.  The example I have seen recently is the work
Olav has been doing to get aggregated data from country system using
analytics api in order to post data to a regional system.  The analytics
api only supports uids, not codes.

So would this address the discomfort about two urls returning the same
resource?  If you want to access the resource then you would access it
through its canonical url, eg

http://apps.dhis2.org/demo/api/dataElements/YtbsuPPo010

But if I have a dataelement code 'DE_34' then I need an endpoint which is
just going to return me 'YtbsuPPo010'.  And similarly if I have an internal
id 546 I should be able to find the corresponding uid.

In fact it would be even more useful to post a set of codes (or ids) for
which I need the corresponding uids.  Presumably this would also be useful
if you were scraping web pages for internal ids.

Bob

On 5 November 2013 10:11, Saptarshi Purkayastha <sunbiz@xxxxxxxxx> wrote:

> Hi Jason,
>
> I am not opposed to it really and think it would be a nice to have (just
>> as it would to be able to search on any property of an object), but what is
>> the real use case here?
>>
>
> The real use-case here is that in Custom Data Entry code, I want to make
> some Web API calls.
> I can easily get the ID on that page and most functionality for web
> interface exposes only IDs. This includes the .action URLs that I want to
> use through a DHIS2 app.
>
> _______________________________________________
> 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
>
>

References