I need to create a RESTful webservice that allows for addressing entities by using different types of IDs. I will give you an example based on books (which is not what I need to process but I want to build a common understanding this way).
Books can be identifier by:
- ISBN 13
- ID
- title
I can create a book by POST
ing to /api/v1/books/The%20Bible
. This book can then later be addressed by its ISBN /api/v1/books/12312312301
or ID /api/v1/books/A9471IZ1
. If I implemented it this way I would need to analyze whatever identifier gets sent and convert it internally.
Is it 'legal' to add the type of identifier to the URL ? Like /api/v1/books/title/The%20Bible
?