Skip to content

Commit fa64132

Browse files
committed
[IIIF-203] Updated bitstreams contract
1 parent e1fcabb commit fa64132

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

bitstreams.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,49 @@ The supported **Request Headers** are:
117117
* Range: not implemented yet. Provide support to partial content download
118118
* If-None-Match: not implemented yet. Support for cache control
119119

120+
### Presigned URL
121+
122+
**GET /api/core/bitstreams/<:uuid>/signedurl**
123+
124+
This endpoint returns a presigned URL that allows direct, temporary access to the bitstream content stored in the configured storage backend (e.g., S3). Clients can use this URL to download the bitstream without passing through the DSpace server, improving performance and offloading bandwidth.
125+
126+
#### Security
127+
128+
- Requires READ permission on the specified bitstream (`hasPermission(#uuid, 'BITSTREAM','READ')`).
129+
130+
131+
#### Response
132+
133+
A JSON object containing:
134+
135+
- `presignedUrl`: The generated presigned URL granting temporary access.
136+
- `bitstreamId`: The UUID of the bitstream.
137+
- `filename`: The user-friendly name of the bitstream (if available).
138+
139+
Example response body:
140+
141+
```json
142+
{
143+
"presignedUrl": "https://bucket.s3.amazonaws.com/object?X-Amz-Algorithm=...",
144+
"bitstreamId": "8d33bdfb-e7ba-43e6-a93a-f445b7e8a1e2",
145+
"filename": "example.pdf"
146+
}
147+
```
148+
149+
150+
#### Error Responses
151+
152+
- **404 Not Found**: If the bitstream with the given UUID does not exist or a presigned URL cannot be generated.
153+
- **401 Unauthorized**: If the requester is anonymous and the bitstream does not have read permissions.
154+
- **403 Forbidden**: If the requester lacks sufficient permissions to read the bitstream.
155+
- **500 Internal Server Error**: If an unexpected error occurs during processing.
156+
157+
158+
#### Notes
159+
160+
- The expiration time of the presigned URL is configurable via the DSpace configuration property `assetstore.s3.presigned.url.expiration.seconds`.
161+
- This URL is intended for temporary direct access and should be used promptly before expiration.
162+
120163
### Main Thumbnail
121164
**/api/core/bitstreams/<:uuid>/thumbnail**
122165

0 commit comments

Comments
 (0)