Shopware icon

Shopware

Shopware

Actions778

Media → Update Media

AI-generated

Overview

The 'Update Media' operation in the Media resource allows users to update various attributes and related entities of a media item in the Shopware system. This operation is useful for scenarios where media metadata, associations, or configurations need to be modified, such as updating file details, changing media folder assignments, or modifying linked entities like tags, categories, and product associations.

Use Case Examples

  1. Updating the file name and size of a media item.
  2. Changing the media folder of an existing media file.
  3. Modifying associated tags or categories for a media item.

Properties

Name Meaning
Id Identifier for the media, required to specify which media item to update.
Response Data format for response, used as a query parameter to specify response format.
User Id Identifier of the user associated with the media.
Media Folder Id Identifier of the media folder to which the media belongs.
Mime Type MIME type of the media file.
File Extension File extension of the media file.
Uploaded At Timestamp when the media was uploaded.
File Name Name of the media file.
File Size Size of the media file in bytes.
Meta Data Additional metadata for the media, provided as JSON.
Media Type Type of media, provided as JSON.
Config Configuration settings for the media, provided as JSON.
Alt Alternative text for the media.
Title Title of the media.
Url URL of the media, a runtime field not used as part of criteria.
Path Path of the media file.
Has File Boolean indicating if the media has an associated file, runtime field.
Private Boolean indicating if the media is private.
Custom Fields Custom fields for the media, provided as JSON.
Created At Timestamp when the media was created.
Updated At Timestamp when the media was last updated.
Translated Translated fields for the media, provided as JSON.
Extensions Extensions related to the media, provided as JSON.
Tags Tags associated with the media, provided as JSON.
Thumbnails Thumbnails related to the media, provided as JSON.
User User entity associated with the media, provided as JSON.
Categories Categories associated with the media, provided as JSON.
Product Manufacturers Product manufacturers linked to the media, provided as JSON.
Product Media Product media associations, provided as JSON.
Product Downloads Product downloads linked to the media, provided as JSON.
Order Line Item Downloads Order line item downloads associated with the media, provided as JSON.
Avatar Users Avatar users linked to the media, provided as JSON.
Media Folder Media folder entity associated with the media, provided as JSON.
Property Group Options Property group options related to the media, provided as JSON.
Mail Template Media Mail template media associations, provided as JSON.
Document Base Configs Document base configurations linked to the media, provided as JSON.
Shipping Methods Shipping methods associated with the media, provided as JSON.
Payment Methods Payment methods linked to the media, provided as JSON.
Product Configurator Settings Product configurator settings related to the media, provided as JSON.
Order Line Items Order line items associated with the media, provided as JSON.
Cms Blocks CMS blocks linked to the media, provided as JSON.
Cms Sections CMS sections associated with the media, provided as JSON.
Cms Pages CMS pages linked to the media, provided as JSON.
Documents Documents associated with the media, provided as JSON.
App Payment Methods App payment methods linked to the media, provided as JSON.
App Shipping Methods App shipping methods associated with the media, provided as JSON.

Output

JSON

  • id - Identifier of the updated media item
  • userId - Identifier of the user associated with the media
  • mediaFolderId - Identifier of the media folder
  • mimeType - MIME type of the media file
  • fileExtension - File extension of the media file
  • uploadedAt - Timestamp when the media was uploaded
  • fileName - Name of the media file
  • fileSize - Size of the media file in bytes
  • metaData - Additional metadata of the media
  • mediaType - Type of the media
  • config - Configuration settings of the media
  • alt - Alternative text for the media
  • title - Title of the media
  • url - URL of the media
  • path - Path of the media file
  • hasFile - Boolean indicating if the media has an associated file
  • private - Boolean indicating if the media is private
  • customFields - Custom fields of the media
  • createdAt - Timestamp when the media was created
  • updatedAt - Timestamp when the media was last updated
  • translated - Translated fields of the media
  • extensions - Extensions related to the media
  • tags - Tags associated with the media
  • thumbnails - Thumbnails related to the media
  • user - User entity associated with the media
  • categories - Categories associated with the media
  • productManufacturers - Product manufacturers linked to the media
  • productMedia - Product media associations
  • productDownloads - Product downloads linked to the media
  • orderLineItemDownloads - Order line item downloads associated with the media
  • avatarUsers - Avatar users linked to the media
  • mediaFolder - Media folder entity associated with the media
  • propertyGroupOptions - Property group options related to the media
  • mailTemplateMedia - Mail template media associations
  • documentBaseConfigs - Document base configurations linked to the media
  • shippingMethods - Shipping methods associated with the media
  • paymentMethods - Payment methods linked to the media
  • productConfiguratorSettings - Product configurator settings related to the media
  • orderLineItems - Order line items associated with the media
  • cmsBlocks - CMS blocks linked to the media
  • cmsSections - CMS sections associated with the media
  • cmsPages - CMS pages linked to the media
  • documents - Documents associated with the media
  • appPaymentMethods - App payment methods linked to the media
  • appShippingMethods - App shipping methods associated with the media

Dependencies

  • an API key credential

Troubleshooting

  • Ensure the 'Id' property is provided and correctly identifies the media to update.
  • Verify JSON fields are correctly formatted to avoid parsing errors.
  • Check API credentials and permissions to ensure the update operation is authorized.
  • Be aware that runtime fields like 'Url' and 'Has File' cannot be used as part of the update criteria.

Discussion