I currently have some end points for notifications:
Create/Update:
POST /notificationsand params:SimpleNotifpojoGet Notifs (listing):
POST /notifications/queryand params:NotifFilterpojoGet Notif:
GET /notifications/{id}and params:idof simple notifDelete Notif:
DELETE /notifications/{id}and params: id again
The NotifFilter pojo has fields like sortBy, offset, limit etc. Now notifications are of two types: simple and composite (aka summary). The above rest end points are used for simple notifications.
The POJOs SimpleNotif and SummaryNotif share lots of attributes as well. A summary notification will have all the same attributes (e.g. name, frequency etc.) along with a list of simple notifications. The summary notification can be triggered based on certain rules e.g. severity of one notification changes or multiple changes etc.
How to handle rest end point design for CRUD for the summary notifications ?
/notifications/summary
will conflict with
/notifications/{id}.
The existing end points take a filter object for filtering, should I introduce type there? I don't think introducing a completely new rest end point is desirable as we already have one for notifications. Any suggestions how to handle CRUD for summarynotif?
Side Note: The reason for using POST for listing ( a GET actually) is URL length restriction in browser.