API: Uploading and downloading images
Upload an image
Request
POST /backend/blobs
Account: demo
IMAGE DATA
| IMAGE DATA | The raw bytes of the image. |
Response
200 OK
TOKEN
| token | The token of the uploaded image. This token can be passed to image transformation functions, or used to download the image. |
CURL example
curl -X POST -H 'Account: demo' --data-binary @image.jpg 'https://api.croppola.com/backend/blobs'
Download an image
Request
GET /backend/blobs/TOKEN
| TOKEN | The image token. |
Response
200 OK
IMAGE DATA
| IMAGE DATA | The raw bytes of the image. |
CURL example
curl -D - 'https://api.croppola.com/backend/blobs/ee0c8eaa2f94630a632ae0f0c3cedc06b71ed19a80b8e5433f7807064a2a2527' -o image.jpg
Download an image with a mime type
The following request returns the raw bytes of an image (as above), but adds a filename witha proper extension and a mime type to the request, so that browsers treat it like a static image.
Request
GET /backend/blobs/TOKEN/FILENAME.EXTENSION
| TOKEN | The image token. |
| FILENAME | The desired image filename. |
| EXTENSION | The image type extension. This must correspond to the image data format. |
Response
200 OK
IMAGE DATA
| IMAGE DATA | The raw bytes of the image. |