商品画像更新
PATCH
/product_images/{product_image_id}
const url = 'https://api.smaregi.dev/TARGET-CONTRACT-ID/ec-b2b/product_images/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"alt":"商品画像01(更新)"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.smaregi.dev/TARGET-CONTRACT-ID/ec-b2b/product_images/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "alt": "商品画像01(更新)" }'商品画像情報を更新します。
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”product_image_id
required
string format: uuid
商品画像ID
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
ProductImageWritable
object
url
画像URL
完全なURLを推奨します。ただし現行システムからの移行データではファイル名(相対パス)が格納・返却される場合があるため、URL形式の検証は行わず素の文字列として扱います。
string
alt
代替テキスト
string
Examples
Exampledefault
{ "alt": "商品画像01(更新)"}Responses
Section titled “Responses”更新成功
Media typeapplication/json
ProductImageResponse
object
id
商品画像ID
string format: uuid
url
画像URL
完全なURLを推奨します。ただし現行システムからの移行データではファイル名(相対パス)が格納・返却される場合があるため、URL形式の検証は行わず素の文字列として扱います。
string
alt
代替テキスト
string
Examples
Exampledefault
{ "id": "33333333-3333-3333-3333-333333333333", "url": "https://example.com/images/product01.jpg", "alt": "商品画像01"}入力チェックエラーの場合
Media typeapplication/json
object
type
required
string
title
required
string
detail
string
status
integer
Example
{ "type": "about:blank", "title": "Bad Request", "detail": "request_json:[url]は文字列で指定してください。", "status": 400}指定されたIDのリソースが見つからない場合
Media typeapplication/json
object
type
required
string
title
required
string
detail
string
status
integer
Example
{ "type": "about:blank", "title": "Not Found", "detail": "指定されたIDのリソースが見つかりません", "status": 404}指定されたURLが既に登録されている場合
Media typeapplication/json
object
type
required
string
title
required
string
detail
string
status
integer
Example
{ "type": "about:blank", "title": "Conflict", "detail": "request_json:[url]はこの項目の値は既に存在しています。違う値を指定してください。", "status": 409}