Closed rap1ds closed 7 years ago
Is the 201 correct status for deleteBlocks endpoint?
Nope. 200 OK sounds better since this is not about creating.
Is the body format correct? Is the response format correct?
These look good to me.
Should the deleteBlocks HTTP verb be DELETE?
Nope. We POST commands. This is a command that happens to delete things (sometimes) but we're not RESTfully deleting resources.
This PR adds two new endpoints:
/bookables/createBlocks
and/bookables/deleteBlocks
POST /bookables/createBlocks
This endpoint takes a list of
start
-end
ranges and creates blocked timeslots. The body of the request is following:The result is a
201
status and the body content is an array of newly created blocks:Status
404
is returned if abookable
can't be found withmarketplaceId
/refId
pair.POST /bookables/deleteBlocks
This endpoint takes a list of block IDs and deletes those blocks. The body of the request is following:
The result is a
201
status and the body content is an array of deleted blocks:Status
404
is returned if abookable
can't be found withmarketplaceId
/refId
pair.Todos / open questions
Questions:
201
correct status fordeleteBlocks
endpoint?deleteBlocks
HTTP verb beDELETE
?Next PR: