Attachings and Attachments APIs
These are APIs only available in the admin namespace.
Attachings API
Create attaching
POST http://gobierto.example/admin/attachments/api/attachings
You'll need to provide the following parameters inside the request body, formatted as JSON:
Paramter | Description | Accepted values |
---|---|---|
attachment_id | ID of attachment | |
attachable_id | ID of attachable | |
attachable_type | Attachable type (class) | 'GobiertoCms::Page' |
Example:
{
"attachment_id": 1,
"attachable_id": 2,
"attachable_type": "GobiertoCms::Page"
}
Delete attaching
DELETE http://gobierto.example/admin/attachments/api/attachings
You'll need to provide the following parameters inside the request body, formatted as JSON:
Paramter | Description | Accepted values |
---|---|---|
attachment_id | ID of attachment | |
attachable_id | ID of attachable | |
attachable_type | Attachable type (class) | 'GobiertoCms::Page' |
Attachments API
Index Attachments
Retrieves a collection of attachments.
GET http://gobierto.example/admin/attachments/api/attachments
Optional parameters:
Paramter | Description | Accepted values |
---|---|---|
page | Used for pagination | - |
attachable_id | Use combined attachable_type to get attachable attachments | - |
attachable_type | Use combined attachable_id to get attachable attachments | 'GobiertoCms::Page' |
search_string | Provide string to search engine | - |
Create attachment
POST http://gobierto.example/admin/attachments/api/attachments
You'll need to provide the following parameters inside the request body, formatted as JSON (example):
{
"attachment": {
"name": "New attachment name",
"description": "New attachment description",
"file_name": "sample_file.txt",
"file": "file content encoded in base64"
}
}
- Name and Description are optional
GET attachment
GET http://gobierto.example/admin/attachments/api/attachments/:id
You can provide the following parameters inside the request body, formatted as JSON (example):
{
"attachment": {
"name": "New attachment name",
"description": "New attachment description",
"file_name": "sample_file.txt",
"file": "file content encoded in base64"
}
}
Update attachment
PATCH http://gobierto.example/admin/attachments/api/attachments/:id
You can provide the following parameters inside the request body, formatted as JSON (example):
{
"attachment": {
"name": "New attachment name",
"description": "New attachment description",
"file_name": "sample_file.txt",
"file": "file content encoded in base64"
}
}
Delete attachment
DELETE http://gobierto.example/admin/attachments/api/attachments/:id
Updated over 4 years ago