REST: Do I have to use the primary_key in the path?

Is there a way to use something other than the an object's ID in a REST-ful API?

For example, if an application stores a collection of plants, can a plant be referenced by the 'scientific_name' rather than the 'primary_key'? If so how?

Taking it one step further, is there a way to automatically strip out underscores from the scientific name before doing a find?

This would be an ideal URL:

/plants/Lilium_humboldtii (instead of /plants/345)

where this plant's scientific name is 'Lilium humboldtii'.

Thanks, Scott

You can achieve this in a number of different ways. I like the way the friendly_identifier plugin works.

http://agilewebdevelopment.com/plugins/friendly_identifier

Michael Guterl