Skip to content Skip to sidebar Skip to footer

Is It Advisable To Return 404 In An Api Call In This Case?

Say there is an api call /super-api/calendar/date/events. The resource 'events' is created only when you add one or more events to a particular date in the calendar. Currently, the

Solution 1:

You're right, you should return an empty list instead of 404 error (you could return 204 though). You could return 404 in queries like this one in case there is no event with id 2.

/super-api/calendar/date/events/2

Post a Comment for "Is It Advisable To Return 404 In An Api Call In This Case?"