Self-hosted storage
This feature is available with the Plugin for Business plan and higher.
If you're on the Plugin for Startup or Plugin Expansion plan, consider upgrading to access this feature. For more details, visit our pricing page or contact support.
If our integrated storage providers don't fit your needs we offer an ability to use your self-hosted storage using various API endpoints. This way we offer a possibility to use our integrated File Manager together with your self-hosted images.
Before implementing the endpoints, check how to work with API endpoints.
List Images
- URL:
/{API.FOLDERS}
- Method:
GET
- Params:
path
,userId
,uuid
- Content-Type:
application/json
Called when File Manager opens. This call used for retrieving files and folders.
Response:
[{
"name": "filename",
"date": "last-date-modified",
"size": 500,
"path": "/path/",
"type": "file" OR "folder",
"extension": ".jpg",
"url": "https://url-to-image.com/image.jpeg"
}]
Insert Folder
Method: POST
- URL:
/{API.FOLDERS}
- Method:
POST
- Content-Type:
application/json
Called when folder is added to the filemanager.
Body:
{
"name": "folder name where the images is added",
"path": "new image directory"
}
Response:
[
{
"url": "url_of_uploaded_image",
},
];
Delete images or folders
- URL:
/{API.FOLDERS}/delete
- Method:
POST
- Content-Type:
application/json
INFO
We append /delete
to the api.FOLDER
URL automatically.
Body:
[
{
"name": "name-of-the-file.jpg",
"type": "file",
"path": "/"
},
{
"name": "name-of-the-folder",
//
"type": "folder",
"path": "/",
"key": null
}
]
Response:
Status code 200
or 204
.
Image upload
- URL:
/{API.IMAGE_UPLOAD}
- Method:
POST
- Content-Type:
application/json
Called when the user wants to upload a new file.
INFO
This endpoint is used even when user drops image to the image block.
Body:
{
"image": "(binary)",
"path": "/",
"uuid": "username"
}
Response:
{
"success": true,
"url": "http://191n.mj.am/img/191n/1t/hs.png"
}
Image upload from image editor
- URL:
/{API.IMAGE_EDITOR_UPLOAD}
- Method:
POST
- Content-Type:
application/json
You should use this endpoint when retrieving edited image from integrated image editor.
Request:
{
"content": "base64 encoded image",
"filename": "Name of the file"
}
Response:
{
"url": "https://url-to-image.com/image.jpeg"
}