It feels like this has been done so many times, it could replace your favorite “Hello World” code. But since I’m a sucker for summaries, here goes.
Get a list of items. If successful, it responds with an array of IDs or objects.
Get a specific item. If successful, returns the object.
If you want to create an new item (making sure it doesn’t exist):
If the item already exists:
If you want to replace an existing item:
Update (change some fields)
If you want to update some fields of an existing item:
If you want to remove an existing item:
This will cover 80%+ of what you need in your daily REST work. Users will expect this behavior and will feel comfortable with it. It also helps design clean APIs.