Assume you are designing Twitter REST API. There are entities called tweet
s. Users are able to retweet
and favorite
those tweets. If you request a tweet
or an aggretation of tweets with an user authentication parameters, how would you indicate that authenticated user has already retweeted
and favorited
those tweets without need to a second API request?
Currently, Twitter API does not have such fields on tweet
entities but somehow its official clients and some 3rd party clients are able to infer whether that tweet is already favorited or retweeted by authenticated user.
By convention, REST responses contain metadata of entities, not the user-entity relationships if I'm not wrong. How does that happen, if you would implement Twitter API, where would you put such fields or would you initiate a second request each of the tweets?