Assets

Update an asset

Craft Cross CMSのアセットを更新します。 ファイルの更新、またはメタデータ(名前、説明、代替テキストなど)の更新が可能です。

Required Scope

APIの実行に必要なScopeです。

beta.cms.asset.update

Required Role

管理画面でScopeを追加する際に必要な権限です。

Craft Cross CMS > メディアライブラリの編集
post/v2beta/cms/asset/update

Request

  • Base URL
    https://api.karte.io
  • URL
    https://api.karte.io/v2beta/cms/asset/update
  • Auth
    HTTP bearer

Headers

x-karte-apistring

今後利用する可能性のある予約語です。現在は設定不要です。

authorizationstring

認証情報を含むトークンです。"Authorization" ヘッダーに Bearer <token> の形式で設定してください。

content-typestring

リクエストのコンテンツタイプを指定します。通常は application/json を使用してください。

Request body multipart/form-data

assetIdstring required

更新対象のアセットID

filestring binary

更新するファイル(オプション)

datastring

アセットのメタデータ(JSON形式の文字列、オプション)。 以下のプロパティを含むJSONオブジェクトを文字列化して送信します:

  • title: アセットのタイトル(string)
  • description: アセットの説明(string)
  • altText: 代替テキスト(string)
  • tagIds: タグIDの配列(array of strings)

Example request

{
  "data": "{\"title\":\"sample.jpg\",\"description\":\"サンプル画像\",\"altText\":\"代替テキスト\"}"
}

Response

A successful response.

idstring required

アセットID

titlestring required

アセットのタイトル

descriptionstring required

アセットの説明

altTextstring required

アセットの代替テキスト

tagIdsstring[] required

アセットに紐づくタグのIDリスト

Changes

No recorded changes to this operation across all 1 revision of this API.