Let's say I have an app to manage sporting teams. Potential users have a role of 'coach', 'player', and 'fan'. In many cases they will have to make similar api calls to retrieve info like this:
/api/v1/players (retrieve all players on their current team)
/api/v1/events (retrieve all events for their current team)
In other cases roles might have certain features only available to them, like this:
/api/v1/opposing_players/:opposing_player_id (retrieve scouting info about an opposing player, not available to fans)
My question boils down to... Should I explicitly break out the apis with a prefix for each role? Or should the API only have one base url?
/api/v1/coaches/events
/api/v1/fans/events
/api/v1/players/events
or
/api/v1/events
/api/v1/{role:string}/events
whererole
is a parameter to the controller function? I have done lots of stuff where parts of the URL are actually parameters that get used in what ever function i am running.