Collection/Resource/Sub-Resource
Returns the sub-resource.
Create a sub-resource that is a single entity as opposed to a collection.
Use a singular suffix for the resource, for example /resident instead of /residents
/resident
/residents
This should return the ID, if applicable, in the response.
Status 409 Conflict should be returned if the sub-resource already exists.
409 Conflict
The client can only POST once to the resource. If the client POST more than once, then they should get an error.
POST
Overwrites the sub-resource if it exists.
Creates the sub-resource if it does not exist.
Updates a subset of the resource's attributes.
Update specific attributes or relationships.
Can pass partial data set to update the resource.
Use with care. PATCH's loose requirements will introduce a higher risk, such as having poor data constraints or difficult-to-read URIs.
PATCH
Consider using PUT instead of PATCH.
PUT
Deletes the resource.
This can be a soft/hard delete or deactivate/archive.
Last updated 1 year ago