When I design a restful API with the asp.net web API do I have to keep in mind that my client side deals with url design representing a state machine?
To make it more clear I am also talking about containment relationship in URL`s.
For example:
I have a User entity which can have many Schooylear entities. I have a Schooylear entity which can have many Period entities.
This results in three web API controller. UserController, SchoolyearController, PeriodController. Now I ask my self should I expose routes like:
api/users/1/schoolyears/2013-2014/periods/2014-01-01
The question would be now how should I map the http route ???
I have actually never seen routes like the above one rather routes like:
api/users/1
api/schoolyears/2013-2014
api/periods/2014-01-01
BUT the above route with the containing relationship would be really helpfull for the user if visible in the url bar...
OR should a restful API not offer a url design representing a state machine ? You see I am confused where the responsibility of the client starts or for the server ends...