Skip to content

Commit 2eb8a13

Browse files
authored
Merge pull request DSpace#350 from saschaszott/saschaszott-patch-8
bitstreams.md: clarify documentation of single / multiple bitstream/s deletion
2 parents 150e09c + e5aacb7 commit 2eb8a13

1 file changed

Lines changed: 22 additions & 9 deletions

File tree

bitstreams.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,32 +205,45 @@ Return codes:
205205
* 403 Forbidden - if you are not logged in with sufficient permissions to see the bitstream metadata
206206
* 422 Unprocessable Entity - if the provided uuid cannot be resolved to an item regardless to the item status
207207

208-
## DELETE Method
208+
## Bitstream Deletion
209209

210-
### Single Bitstream Delete
211-
Delete a bitstream. Works for normal bitstreams in an Item (bundle), and a community or collection logo
210+
### Deletion of a single bitstream
212211

212+
**DELETE /api/core/bitstreams/<:bitstream_uuid>**
213+
214+
Deletes the bitstream identified by the given UUID. This endpoint supports deleting bitstreams associated with items (via bundles), as well as bitstreams used as community or collection logos.
215+
216+
Return codes:
213217
* 204 No content - if the operation succeed
214218
* 401 Unauthorized - if you are not authenticated
215219
* 403 Forbidden - if you are not loggedin with sufficient permissions
216220
* 404 Not found - if the bitstream doesn't exist (or was already deleted)
217221
* 422 Unprocessable Entity - if the bitstream is a community or collection logo
218222

219-
### Multiple Bitstreams Delete
220-
Delete a list of Bitstreams in one request. This will work for any list of Bitstreams that are attached to an item, will mostly be used in the item admin edit
223+
### Deletion of multiple bitstreams in a single request
224+
225+
**PATCH /api/core/bitstreams**
226+
227+
A `PATCH` request can be used to delete multiple bitstreams in a single request. This endpoint supports deleting any number of bitstreams attached to an item and is primarily intended for use by the item administration edit interface (in the Angular UI).
221228

229+
Return codes:
222230
* 204 No content - if the operation succeeded
223231
* 401 Unauthorized - if you are not authenticated
224232
* 403 Forbidden - if you are not logged in with sufficient permissions
225233
* 404 Not found - if any of the bitstreams in the list haven't been found or are already deleted
226234
* 422 Unprocessable Entity - If one or more of the given Bitstreams aren't attached to an Item.
227235

228-
A sample CURL command would be:
229-
```
230-
curl -i -X PATCH 'https://demo7.dspace.org/server/api/core/bitstreams -H 'Authorization: Bearer eyJhbGciO…' -H "content-type: application/json" --data '[ { "op": "remove", "path": "/bitstreams/12623672-25a9-4df2-ab36-699c4c240c7e"}, { "op": "remove", "path": "/bitstreams/5a3f7c7a-d3df-419c-8a2-f00ede62c60a"}]'
236+
A sample `curl` command to delete two bitstreams in a single `PATCH` request would be:
237+
238+
```sh
239+
curl -i -X PATCH https://demo7.dspace.org/server/api/core/bitstreams \
240+
-H 'Authorization: Bearer …' \
241+
-H 'content-type: application/json' \
242+
--data '[ { "op": "remove", "path": "/bitstreams/12623672-25a9-4df2-ab36-699c4c240c7e"}, { "op": "remove", "path": "/bitstreams/5a3f7c7a-d3df-419c-8a2-f00ede62c60a"}]'
231243
```
232244

233-
The Patch contents is:
245+
The `PATCH` request body includes the UUIDs of the bitstreams to be deleted.
246+
234247
```json
235248
[
236249
{

0 commit comments

Comments
 (0)