dimanche 14 août 2016

Design of RESTful API

i developed a simple API which represent a library where users can have books.

Example:

http://library/api/users/:user_id/books/:book_id

The id of the user and the book are unique. It is possible to find the book without the id of the user.

And sometimes i don't even know the id of the user.

Is it legit now to have URLs like the following?

http://library/books/:book_id

Are there other patterns to solve my problem?

Thanks!

Aucun commentaire:

Enregistrer un commentaire