/system/blobs/:id/attachments
Path: /system/blobs/:id/attachments
Namespace: system
Parent Resource: blobs
Overview
Attachments represent files attached to a blob. Each attachment contains file information, metadata, and content.
Available Operations
List Attachments (GET)
Endpoint: GET /system/blobs/:id/attachments.json
Description: Retrieve all attachments for a specific blob.
Request Example:
GET /system/blobs/123/attachments.jsonResponse (200 OK):
{
"attachments": [
{
"id": 1,
"blob_id": 123,
"filename": "document.pdf",
"content_type": "application/pdf",
"file_size": 102400
}
]
}2
3
4
5
6
7
8
9
10
11
Show Attachment (GET /:id)
Endpoint: GET /system/blobs/:id/attachments/:id.json
Description: Retrieve a specific attachment.
Request Example:
GET /system/blobs/123/attachments/1.jsonResponse (200 OK):
{
"attachment": {
"id": 1,
"blob_id": 123,
"filename": "document.pdf",
"content_type": "application/pdf",
"file_size": 102400
}
}2
3
4
5
6
7
8
9
Create Attachment (POST)
Endpoint: POST /system/blobs/:id/attachments.json
Description: Create a new attachment for a blob.
Request Example:
POST /system/blobs/123/attachments.json
Content-Type: multipart/form-data
{
"attachment": {
"file": "<file_data>",
"filename": "new_document.pdf"
}
}2
3
4
5
6
7
8
9
Response (201 Created):
{
"attachment": {
"id": 2,
"blob_id": 123,
"filename": "new_document.pdf"
}
}2
3
4
5
6
7
Update Attachment (PATCH /:id)
Endpoint: PATCH /system/blobs/:id/attachments/:id.json
Description: Update an existing attachment.
Request Example:
PATCH /system/blobs/123/attachments/1.json
Content-Type: application/json
{
"attachment": {
"filename": "updated_document.pdf"
}
}2
3
4
5
6
7
8
Response (200 OK):
{
"attachment": {
"id": 1,
"filename": "updated_document.pdf"
}
}2
3
4
5
6
Delete Attachment (DELETE /:id)
Endpoint: DELETE /system/blobs/:id/attachments/:id.json
Description: Delete an attachment.
Request Example:
DELETE /system/blobs/123/attachments/1.jsonResponse (204 No Content)
Batch Actions (POST /batch_action)
Endpoint: POST /system/blobs/:id/attachments/batch_action.json
Description: Perform batch operations on selected attachments.
Request Example:
POST /system/blobs/123/attachments/batch_action.json
Content-Type: application/json
{
"batch_action": "delete",
"collection_selection": [1, 2, 3]
}2
3
4
5
6
7
Response (200 OK):
{
"message": "Batch action completed",
"affected_count": 3
}2
3
4
Related Documentation
- Blob Resource - Parent blob resource
- Attachments Resource - Attachments management