楽天API:フォルダを指定し画像を登録
R-Cabinetの指定フォルダに画像を保存するAPI
R-Cabinetに画像を保存するとても重要なAPI。
フォルダ指定の際にはフォルダIDにて指示しないといけない。SQLにフォルダID一覧を登録する事が利用の条件となる。※フォルダ一覧情報が無い場合、複数のAPI呼び出しを実行しなければならない。
APIメソッド:cabinet.file.insert
この機能を利用すると、画像ファイルを指定して画像を登録することができます。
Endpoint / HTTP Method
Endpoint | HTTP Method |
---|---|
https://api.rms.rakuten.co.jp/es/1.0/cabinet/file/insert | POST |
Request
HTTP Header
2Content-Typemultipart/form-data
No | Key | Value | Note |
---|---|---|---|
1 | Authorization | ESA Base64(serviceSecret:licenseKey) | |
2 | Content-Type | multipart/form-data |
HTTP Body
Form Values
No | Key | Description | Mandatory | Type | Note |
---|---|---|---|---|---|
1 | xml | リクエスト | 〇 | String | APIのパラメータ |
2 | file | 画像情報 | 〇 | binary | HTMLのフォームを使ったファイルアップロード 1ファイルあたりの重さ : 2MBまで 1ファイルあたりのサイズ : 横1600×縦1200pixelまで 登録可能な形式 : JPEG、GIF、アニメーションGIF、PNG、TIFF、BMP ※PNG、TIFF、BMP形式の画像はJPEGに変換 (その他の形式はエラー) |
XML:request
No | Element | Description | Type | Size(byte) | Mandatory | Multiplicity | Note |
---|---|---|---|---|---|---|---|
1 | request.fileInsertRequest | 画像情報登録要求 | XML: fileInsertRequest | – | 〇 | 1 |
XML:fileInsertRequest
No | Element | Description | Type | Size(byte) | Mandatory | Multiplicity | Note |
---|---|---|---|---|---|---|---|
1 | fileInsertRequest.file | 画像情報 | XML:file | – | 〇 | 1 |
XML:file
No | Element | Description | Type | Size(byte) | Mandatory | Multiplicity | Note |
---|---|---|---|---|---|---|---|
1 | file.fileName | 登録画像名 | Integer | 50 | ○ | 1 | 50バイト以内(全角25文字以内/半角50文字以内) 使用禁止文字 : 機種依存文字(コントロールコード除く)、半角カタカナ 全角スペース → 半角スペースに変換 スペースのみは不可 前後にスペースがある場合は、スペースを自動削除 タグは無効(入力した場合は、タグと判断されたものを削除して表示) |
2 | file.folderId | 登録先フォルダID | Integer | 10 | ○ | 0,1 | |
3 | file.filePath | 登録file名 | String | 20 | 0,1 | 20バイト以内(半角20文字以内) デフォルト値 : img[数字8桁].gif / jpg or imgrc[数字10桁].gif / jpg 入力可能文字 : 半角英数字(小文字)/記号は「-」「_」のみ 使用禁止文字 : 機種依存文字(コントロールコード含む)、img+8桁の数字、imgrc+10桁の数字 スペースのみ/字間にスペースは不可 前後にスペースがある場合は、スペースは自動削除 タグは無効(入力した場合はタグと判断されたものを削除して表示) |
|
4 | file.overWrite | 上書きフラグ | boolean | – | 0,1 | デフォルト値 : false |
Response
HTTP Header
No | Key | Value |
---|---|---|
1 | Content-Type | text/xml |
HTTP Body
XML:result
No | Element | Description | Type | Size(byte) | Multiplicity | Note |
---|---|---|---|---|---|---|
1 | result.status | ステータス | XML : status | – | 1 | interfaceId=cabinet.file.insert |
2 | result.cabinetFileInsertResult | 画像情報登録結果 | XML : cabinetFileInsertResult | – | 1 |
XML:cabinetFileInsertResult
No | Element | Description | Type | Size(byte) | Multiplicity | Note |
---|---|---|---|---|---|---|
1 | cabinetFileInsertResult.resultCode | 結果コード | Integer | 4 | 1 | |
2 | cabinetFileInsertResult.FileId | 画像ID | Integer | 10 | 1 |
-
前の記事
楽天API:削除フォルダの画像を指定して移動 2018.09.14
-
次の記事
楽天API:R-Cabinet内画像の上書き 2018.09.14
コメントを残す