contentsholder/images.upload

画像をアップロード

URL

POST /v1.0/contentsholder/images.upload

パラメータ

名前 必須 デフォルト値 説明
unit_id 必須 - コンテンツホルダー・ユニットのID
file 必須 - ファイル。8MB以下のサイズ。
caption 任意 空文字 キャプション(画像の説明文)

multipart/form-data形式で送信してください。長辺1920ピクセルを超えるファイルは、長辺1920ピクセルにリサイズされて保存されます。

レスポンス

{
        "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": "懐かしい",
            "created_at": "2018-03-05T06:20:40+00:00",
            "updated_at": "2018-03-05T06:20:40+00:00",
            "unit":{
                "id": "1234567",
                "name": "ノアドット新聞",
                "status": "public",
                "signature_color": "0f0f0f",
                "header_type": "background",
                "header_position": "center",
                "copyright_owner": "株式会社ノアドット新聞",
                "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": "株式会社ノアドット新聞",
                "created_at": "2015-11-16T19:02:38+00:00",
                "updated_at": "2018-02-06T17:29:41+00:00"
            },
            "language": "en-US",
            "timezone": "Asia/Tokyo"
            }
        }
    }
}

更新後のデータを返します。詳細は、contentsholder imageオブジェクトを参照してください。

エラー

エラーコード 説明
no_unit_id unit_idが必須なのに渡されていない
invalid_unit_id 不正なunit_idの指定
unit_not_found ユニットが見つからない
no_file fileが必須なのに渡されていない
invalid_file 不正なfileの指定
invalid_caption 不正なcaptionの指定

上記以外のエラーは、共通エラーの項目を参照してください。