Header name | Description |
---|---|
Content-Type required |
application/json |
X-API-KEY required |
YOUR_API_KEY |
Param name | Description |
---|---|
name optional |
Image crop name Validations:
|
aspect optional |
Image crop aspect ratio Validations:
|
x optional |
Image crop X coordinate Validations:
|
y optional |
Image crop Y coordinate Validations:
|
height optional |
Image crop height Validations:
|
width optional |
Image crop width Validations:
|
zoom optional |
Image crop zoom for preview tool Validations:
|
source_media_version optional |
Media version to use, defaults to 'original' Validations:
|
// Successful request POST /api/v2/assets/_dpDVO0UAPQcFHzFysei/image_crops/4 { "name": "16:9", "aspect": "1.778", "x": 960, "y": 540, "width": 480, "height": 270, "zoom": "1.00", "source_media_version": "original" } 200 { "image_crop": { "name": "16:9", "aspect": 1.778, "x": 960, "y": 540, "width": 480, "height": 270, "zoom": 1.0, "source_media_version": "original", "id": 4 } }
// Asset not found POST /api/v2/assets/:asset_id/image_crops/5 { "name": "16:9", "aspect": "1.778", "x": 960, "y": 540, "width": 480, "height": 270, "zoom": "1.00", "source_media_version": "original" } 404 { "error": "asset not found" }
// Image crop not found POST /api/v2/assets/X_xf03UqAz_JkvF_PS1d/image_crops/:image_crop_id { "name": "16:9", "aspect": "1.778", "x": 960, "y": 540, "width": 480, "height": 270, "zoom": "1.00", "source_media_version": "original" } 404 { "error": "Couldn't find ImageCrop with 'id'=:image_crop_id [WHERE \"image_crops\".\"asset_id\" = $1]" }
// Invalid parameters POST /api/v2/assets/5x-MlA1ocaK31KMb1jFM/image_crops/6 { "name": "16:9", "aspect": "1.778", "x": 960, "y": 540, "width": 480, "height": 270, "zoom": "0.99", "source_media_version": "original" } 400 { "error": "Validation failed: Zoom must be greater than or equal to 1.0" }
Code | Description |
---|---|
401 | Unauthorized |
404 | Not found |
500 | Internal Server Error |
422 | Missing parameters |