contentsholder/images.upload
Uploads an image in your Content Owner Media Unit
URL
POST /v1.0/contentsholder/images.upload
Parameter
Argument | Required | Default Value | Example | Description |
---|---|---|---|---|
unit_id | Required | - | 12345678912345 | ID of your Content Owner Media Unit |
file | Required | - | Image file. The file size should not exceed 8MB. | |
caption | Optional | Null | The buds of sakura will bloom soon. | Describes the image. |
Image upload requires use of multipart/form-data format. Image sizes (width or height) exceeding 1920 pixels will be automatically resized to 1920 pixels.
Responses
{
"ok": true,
"image":{
"id": "0123456",
"filename": "0123456-0123-4156-866e-07f5eb5832c6.jpeg",
"url": "https://nordot-res.cloudinary.com/t_size_l/ch/images/0123456/origin_1.jpg",
"url_w": 800,
"url_h": 326,
"thumb_360": "https://nordot-res.cloudinary.com/t_thumb_360/ch/images/0123456/origin_1.jpg",
"caption": "Nostalgic",
"created_at": "2018-03-05T06:20:40+00:00",
"updated_at": "2018-03-05T06:20:40+00:00",
"unit":{
"id": "1234567",
"name": "Nordot Post",
"status": "public",
"signature_color": "0f0f0f",
"header_type": "background",
"header_position": "center",
"copyright_owner": "Nordot Inc.",
"default_post_expire_days": 0,
"created_at": "2015-11-16T19:06:46+00:00",
"updated_at": "2018-03-05T05:45:25+00:00",
"header_image":{
"url": "https://nordot-res.cloudinary.com/ch/units/1234567/header_1.png",
"url_w": 400,
"url_h": 60,
"thumb_360": "https://nordot-res.cloudinary.com/t_thumb_360/ch/units/1234567/header_1.png",
"square_300": "https://nordot-res.cloudinary.com/t_square_300/ch/units/1234567/header_1.png"
},
"profile_image": null,
"publisher":{
"id": "0012345",
"name": "Nordot Inc.",
"created_at": "2015-11-16T19:02:38+00:00",
"updated_at": "2018-02-06T17:29:41+00:00"
},
"language": "en-US",
"timezone": "Asia/Tokyo"
}
}
}
}
If successful, the method returns generated data. For more details, please refer to the “contentsholder image” object.
Errors
Error Code | Description |
---|---|
no_unit_id | Value for "unit_id" is not specified. |
invalid_unit_id | Value passed for “unit_id" is invalid. |
unit_not_found | The Media Unit cannot be found. |
no_file | Value for “file” is not specified. |
invalid_file | Invalid file format. |
invalid_caption | Value passed for “caption” is invalid. |
For other error codes, refer to the Common Errors section of this document.