I am designing REST. I have user and user has contacts of different types. What should my endpoints be like according to REST?
This looks reasonable:
GET /users/:id/contacts
GET /contacts
On users endpoint I check contacts for another user and on contacts endpoint I check logged in user in contacts, but then if I need to get all contacts for all users I need to make a filter:
GET /contacts?user_id=:id
And make this endpoint return all contacts. And this makes endpoint on users redundant.
What is correct way to do it according to REST?