Google Groups

Re: Question: RESTful search


Darrel Miller Feb 12, 2012 1:36 PM
Posted in group: API Craft
Brian,

Having a root api document that contains something like,

<link rel="urn:acme:globalsearch" href="/search?q={keywords}" />
<link rel="urn:acme:dogsearch" href="/dogs?q={keywords}" />

means that developers can probably guess how to search the site.
There is no need to reference "API documentation", just do a GET on
the root of the API and see what it has to offer.

Or if you don't want to invent your own search link relations, you
could always use the OpenSearch standard.  All this work has been done
before, there really is no need to re-invent the wheel for every new
API.

Trying to create "web wide" URL conventions is going to be painful task.

Darrel


On Fri, Feb 10, 2012 at 6:55 PM, landlessness <br...@apigee.com> wrote:
> helen and i are working on an ebook for web api design and this discussion
> has forced a rev on the search section.
>
> we're going to suggest the following for scoped search:
>
> /dogs?q=foo+bar
>
> and for global search:
>
> /search?q=foo+bar
>
> doing global search as just a query param felt like it would be hard
> capability to discover and document. whereas /search?q= felt easy to
> discover and simple.
>
> colton thanks for suggesting this nugget, ed, luke, will, et al thanks for
> the great chatter.