Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Thanks for interesting conception! But seems like that it does not resolve the main issue - concrete set of tokens depends on the concrete client. As example: for client "guest" token "1", for client "admin" token "2". For now - token collection can be retrieved only for concrete user. But in future this may change and will be a separate resource "token" for any users. Then it is necessary to keep the two URIs: /user/:name/token and /token. Commented Aug 5, 2016 at 21:09
  • So basically you would have in the resource representation of /user/:name/token a subset of the resource representation of /token ? Because resource representation of /token contains a collection of token linked to a client ? Commented Aug 5, 2016 at 21:38
  • We have many resources which now can be retrieved only for concrete user, as /user/:name/token. But it's just for now. In future some of this resources may take posibility to retrieve without user, as /token, for example. Commented Aug 6, 2016 at 8:47
  • That's perfectly valid with my answer. Basically you want to avoid coupling resources in URI (token& user/:name resource). Thus your only option is to use an field in your /token resource referencing a /user/:name like an id for example (that's very similiar to foreign key in database!),. That's basically your solution 2. However, if a client want to know further information about the the user when he retrieve the resource /token, you should also include links... that's what i said in my answer :) Commented Aug 6, 2016 at 15:59