web

Image

0.001 credits per request

Convert

POST /v1/image/Convert

Convert an image from one format (jpeg, png etc.) to an other either on the fly (from base64 to base64), or by uploading the conversion result. To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json with each parameter as a form field.

Request

base64string

base64 encoded image to resize,

filestring

The image file to convert

namestring

output name of the image including extension, ie. "cat.png"

outputURLboolean

make output a URL and not a base64 response

urlstring

url of the image to resize

Response

base64string

urlstring

Request

Response

{
    "url": "cdn.images.m3o.com/your-account-id/cat.jpeg"
}

0.000001 credits per request

Delete

POST /v1/image/Delete

Delete an image previously uploaded.

Request

urlstring

url of the image to delete e.g. https://cdn.m3ocontent.com/micro/images/micro/41e23b39-48dd-42b6-9738-79a313414bb8/cat.jpeg

Response

{}

Request

Response

{}

0.001 credits per request

Resize

POST /v1/image/Resize

Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters. If one of width or height is 0, the image aspect ratio is preserved. Optional cropping. To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json with each parameter as a form field.

Request

base64string

base64 encoded image to resize,

cropOptionsobject

optional crop options if provided, after resize, the image will be cropped

filestring

The image file to resize

heightnumber

namestring

output name of the image including extension, ie. "cat.png"

outputURLboolean

make output a URL and not a base64 response

urlstring

url of the image to resize

widthnumber

Response

base64string

urlstring

Request

Response

{
    "url": "cdn.images.m3o.com/your-account-id/cat.png"
}

0.01 credits per request

Upload

POST /v1/image/Upload

Upload an image by either sending a base64 encoded image to this endpoint or a URL. To resize an image before uploading, see the Resize endpoint. To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json with each parameter as a form field.

Request

base64string

Base64 encoded image to upload,

filestring

The image file to upload

namestring

Output name of the image including extension, ie. "cat.png"

urlstring

URL of the image to upload

Response

urlstring

Request

Response

{
    "url": "cdn.images.m3o.com/your-account-id/cat.jpeg"
}