Given a URL structure like this:
GET /user/giftcards/:id
When returning list with all my giftcard:
GET /user/giftcards
And here comes my questions, what is best practice for URL structure if I also want to return subsections of the giftcards, like received or sent?
Today I do this (but I know its wrong since the URL should represents the noun / resource (here: giftcard)
GET /user/giftcardsreceived
GET /user/giftcardssent
The way I see it there are two "better" solutions:
GET /user/giftcards/received
GET /user/giftcards/sent
or
GET /user/giftcards?filter=received
GET /user/giftcards?filter=sent
Im leaning towards the request param solution with filtering since the other solution could potentially conflict with the GET based on id.
Any pointing in right direction appreciated.