Image routes
Base URLs, authentication and the response envelope are in Requests and responses. To delete many images in one call, or to change the division, tag or groups of many, use the dataset routes.
| Route | Purpose |
|---|---|
POST /image/{imageId}/delete | Delete one image |
POST /image/thumbnails | Create the preview of images that have none |
Delete an image
POST /image/{imageId}/deleteNo body. Deletes the original file first, then the image, and finally the previews that no other image uses and the masks of the image.
{ "data": { "id": "Qm3xZ0aT9kLw2VbN7cYd", "failedFiles": [] } }If the original file cannot be deleted the answer is 500 and the image is kept, so an image never loses its file while it is still listed. failedFiles lists previews or masks that could not be removed after the image was deleted.
404 if the image does not exist.
Thumbnails
POST /image/thumbnails{
"images": [
{ "id": "Qm3xZ0aT9kLw2VbN7cYd", "url": "https://firebasestorage.googleapis.com/v0/b/<projectId>/o/…" }
],
"size": 512
}| Field | Required | Meaning |
|---|---|---|
images | yes | Up to 50 images, each with its id and the http(s) URL of its original file |
size | no | Longest side of the preview in pixels (default 512). A value outside 128 to 1024 is brought into that range |
Images that arrive from outside the uploader of the application, such as captures sent from Node-RED, have no preview. This route creates a JPEG preview once, stores it and records it on the image, so later calls return the stored one without creating it again. A preview is never larger than the original.
The answer maps each image id to the URL of its preview, or to null when the image does not exist or the preview could not be created:
{
"data": {
"Qm3xZ0aT9kLw2VbN7cYd": "https://firebasestorage.googleapis.com/v0/b/<projectId>/o/thumbnails%2FQm3xZ0aT9kLw2VbN7cYd-preview.jpeg?alt=media&token=…"
}
}One image that fails does not fail the call. 400 if images is missing or has more than 50 entries.