Skip to content

Commit 90d7295

Browse files
authored
Merge pull request #300 from nibou230/2413-bitstream-access-status
Added the new accessStatus endpoint for bitstreams
2 parents 546ace8 + 44c2b6e commit 90d7295

File tree

2 files changed

+72
-2
lines changed

2 files changed

+72
-2
lines changed

bitstreams.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,62 @@ Exposed links:
3838
Bitstream metadata can be modified as described in [Modifying metadata via Patch](metadata-patch.md).
3939

4040
## Linked entities
41+
42+
### Access Status
43+
**GET /api/core/bitstreams/<:uuid>/accessStatus**
44+
45+
This endpoint expose the mechanism for retrieving and calculating the access status of a DSpace bitstream based on the anonymous group or the current user, depending on the system configuration. See access.status.for-user.bitstream property in the dspace.cfg file. The result includes the embargo date in a YYYY-MM-DD format only if the status is embargo. It can be checked by calling this endpoint with the corresponding bitstream UUID.
46+
47+
Example: <https://demo.dspace.org/server/#https://demo.dspace.org/server/api/core/bitstreams/8d33bdfb-e7ba-43e6-a93a-f445b7e8a1e2/accessStatus>
48+
49+
It returns the access status of the bitstream, E.G.:
50+
51+
_200 - Response if the UUID parameter is valid_
52+
```json
53+
{
54+
"status": "metadata.only",
55+
"embargoDate": null,
56+
"type": "accessStatus",
57+
"_links" : {
58+
"self" : {
59+
"href" : "http://{dspace-server.url}/api/core/bitstreams/8d33bdfb-e7ba-43e6-a93a-f445b7e8a1e1/accessStatus"
60+
}
61+
}
62+
}
63+
```
64+
_Includes the embargo date when the status is embargo..._
65+
```json
66+
{
67+
"status": "embargo",
68+
"embargoDate": "2050-01-01",
69+
"type": "accessStatus",
70+
"_links" : {
71+
"self" : {
72+
"href" : "http://{dspace-server.url}/api/core/bitstreams/8d33bdfb-e7ba-43e6-a93a-f445b7e8a1e2/accessStatus"
73+
}
74+
}
75+
}
76+
```
77+
78+
Fields
79+
- Status: String value if the UUID is valid
80+
- EmbargoDate: String value, the accessibility date in YYYY-MM-DD format
81+
- Type: Type of the endpoint, "accessStatus" in this case
82+
83+
Exposed links:
84+
- self: The valid URL to the bitstream's access status
85+
86+
Default access status values
87+
- open.access = The file is downloadable
88+
- embargo = The file is under an embargo
89+
- restricted = The file is not downloadable
90+
- unknown = The file is null
91+
92+
Return code
93+
- 200 Ok if the parameter is a valid item UUID
94+
- 400 Bad Request if the parameter is invalid
95+
- 404 Not Found if the item cannot be retrieved
96+
4197
### Format
4298
**GET /api/core/bitstreams/<:uuid>/format**
4399

items.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,7 @@ the discoverable operation will result in:
282282

283283
**GET /api/core/items/<:uuid>/accessStatus**
284284

285-
This endpoint expose the mechanism for retrieving and calculating the access status of a DSpace item.
286-
It can be checked by calling this endpoint with the the corresponding item UUID.
285+
This endpoint expose the mechanism for retrieving and calculating the access status (including the embargo date) of a DSpace item based on the anonymous group or the current user, depending on the system configuration. See access.status.for-user.item property in the dspace.cfg file. The result includes the embargo date in a YYYY-MM-DD format only if the status is embargo. It can be checked by calling this endpoint with the corresponding item UUID.
287286

288287
```
289288
curl -v "http://{dspace-server.url}/api/core/items/2245f2c5-1bed-414b-a313-3fd2d2ec89d6/accessStatus"
@@ -295,6 +294,7 @@ _200 - Response if the UUID parameter is valid_
295294
```json
296295
{
297296
"status": "metadata.only",
297+
"embargoDate": null,
298298
"type": "accessStatus",
299299
"_links" : {
300300
"self" : {
@@ -303,9 +303,23 @@ _200 - Response if the UUID parameter is valid_
303303
}
304304
}
305305
```
306+
_Includes the embargo date when the status is embargo..._
307+
```json
308+
{
309+
"status": "embargo",
310+
"embargoDate": "2050-01-01",
311+
"type": "accessStatus",
312+
"_links" : {
313+
"self" : {
314+
"href" : "http://{dspace-server.url}/api/core/items/2245f2c5-1bed-414b-a313-3fd2d2ec89d7/accessStatus"
315+
}
316+
}
317+
}
318+
```
306319

307320
Fields
308321
- Status: String value if the UUID is valid
322+
- EmbargoDate: String value, the accessibility date in YYYY-MM-DD format
309323
- Type: Type of the endpoint, "accessStatus" in this case
310324

311325
Exposed links:

0 commit comments

Comments
 (0)