appdotnet / api-spec

App.net API Documentation is on the web at https://developers.app.net. Source for these docs is in the new-docs branch here. Please use the issue tracker and submit pull requests! Help us build the real-time social service where users and developers come first, not advertisers.
https://developers.app.net
950 stars 98 forks source link

Post created by user / user mentioned are under users domain #95

Closed arikg closed 12 years ago

arikg commented 12 years ago

The endpoint for all posts api calls (except 2) is https://alpha-api.app.net/stream/0/posts The two that start with a different url are "posts created by user" and "posts mentioning a user". They both start with: https://alpha-api.app.net/stream/0/users/[user_id]/

I do not think this is the right way to do it. Getting all posts that were created or mention a user is just another filter on posts and should be treated like that. Even the return value is a list of posts - I really think it belongs to the posts domain.

My suggestion is:

What do you think? @arikg

abraham commented 12 years ago

The current design would be considered best practice.

http://blog.apigee.com/detail/simplify_associations_sweep_complexities_under_the_http/

arikg commented 12 years ago

I see your point, it still feels a bit weird to me and I even might prefer his last suggestion of adding it as a parameter. but if it stays like that it should probably be moved in the documentation to be part of the users.md. I might have been led to think that's it's faulty because it was listed under the posts.md while actually being part of the users entity...

mthurman commented 12 years ago

I think where those URLs are makes sense. Those posts "belong" in some way to a user object so nesting them under /users/ makes sense. In the api docs, we're grouping based on the responses they return. Since they're returning posts, they are grouped with the post resources.