I have a REST API in development were some resources are user related, and users need to authenticate to access those resources. It's tempting to take a shortcut and replace an identifier of:
considering that the user_id is known based on authentication data. In such case the /profile/ identifier means a different resource for each user. This does not seem very representational, unless we consider that the Authentication header is being a part of the identifier.
A more complex example when let's say there is an 'item' resource available for all users and every user can set their own 'label' property to an item. Again it's tempting to have just
I have found one example where striping the user_id part has lead to potential problems (a case where an admin user was introduced, who should be able to access all users resources, but also filter them by user - A Web application as a REST API client: how to handle resource identifiers) but it didn't seem a very big issue. Are there any good reasons why authentication data should not be considered part of the resource identifier?