openreferral / api-specification

This is the working repository for Open Referral's Human Services Data API protocols.
https://openreferral.readthedocs.io/en/latest/hsda/
Other
29 stars 13 forks source link

Direct updates of subresources #51

Open boxfoot opened 6 years ago

boxfoot commented 6 years ago

Let's say I have an organizational phone id (let's say 12345), and I want to get the whole record from the API. But I don't necessarily know the right organization id.

The format for phones is: /organizations/{orgId}/phones/{phoneId}

Is there a way for me to GET (or PUT changes) without knowing the organization id? Based on my current reading of version 1.1, there isn't. Should we add something like Google that would let me GET /organizations/-/phones/12345 for this situation?

kinlane commented 6 years ago

Good thoughts.

I'd say #46 and #42 contribute to the GET portion, with addition of /search?phone=

But, your approach gracefully deals with GET and POST--providing an interesting design pattern to consider.

kinlane commented 6 years ago

After the last round, my recommendation here is that sub resources also get introduced as top level resources, similar to how /services is, but more actually like /contacts is currently. I'd say services has become a top level, but /contacts is in limbo.

Example:

/contacts /phones /physical_address /mailing_address /holiday_schedule /regular_schedule/ /disabilities

Maybe even shortening:

/address /schedule

All allowing for:

Many other discovery types scenarios, rather than just wildcard. This is definitely lower priority, as there are bigger fishes to fry currently.