Retrieve the list of gallery entries associated with given product

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://magento2.doc.winkelstraat.nl/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "Magento2 MCP server": {
    "url": "https://magento2.doc.winkelstraat.nl/mcp"
  }
}

Close
GET /V1/products/{sku}/media

Retrieve the list of gallery entries associated with given product

Path parameters

  • sku string Required

Responses

  • 200 Success.

    Hide response attributes Show response attributes object
    • id integer

      Gallery entry ID

    • media_type string Required

      Media type

    • label string Required

      Gallery entry alternative text

    • position integer Required

      Gallery entry position (sort order)

    • disabled boolean Required

      If gallery entry is hidden from product page

    • types array[string] Required

      Gallery entry image types (thumbnail, image, small_image etc)

    • file string

      File path

    • content object

      Image Content data interface

      Hide content attributes Show content attributes object
      • base64_encoded_data string Required

        Media data (base64 encoded content)

      • type string Required

        MIME type

      • name string Required

        Image name

    • extension_attributes object

      ExtensionInterface class for @see \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface

      Hide extension_attributes attribute Show extension_attributes attribute object
      • video_content object

        Video Content data interface

        Hide video_content attributes Show video_content attributes object
        • media_type string Required

          MIME type

        • video_provider string Required

          Provider

        • video_url string Required

          Video URL

        • video_title string Required

          Title

        • video_description string Required

          Video Description

        • video_metadata string Required

          Metadata

    Hide response attributes Show response attributes object
    • id integer

      Gallery entry ID

    • media_type string Required

      Media type

    • label string Required

      Gallery entry alternative text

    • position integer Required

      Gallery entry position (sort order)

    • disabled boolean Required

      If gallery entry is hidden from product page

    • types array[string] Required

      Gallery entry image types (thumbnail, image, small_image etc)

    • file string

      File path

    • content object

      Image Content data interface

      Hide content attributes Show content attributes object
      • base64_encoded_data string Required

        Media data (base64 encoded content)

      • type string Required

        MIME type

      • name string Required

        Image name

    • extension_attributes object

      ExtensionInterface class for @see \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface

      Hide extension_attributes attribute Show extension_attributes attribute object
      • video_content object

        Video Content data interface

        Hide video_content attributes Show video_content attributes object
        • media_type string Required

          MIME type

        • video_provider string Required

          Provider

        • video_url string Required

          Video URL

        • video_title string Required

          Title

        • video_description string Required

          Video Description

        • video_metadata string Required

          Metadata

  • Unexpected error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Errors list

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters list

        Hide parameters attributes Show parameters attributes object

        Error parameters item

        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters list

      Hide parameters attributes Show parameters attributes object

      Error parameters item

      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Errors list

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters list

        Hide parameters attributes Show parameters attributes object

        Error parameters item

        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters list

      Hide parameters attributes Show parameters attributes object

      Error parameters item

      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

GET /V1/products/{sku}/media
curl \
 --request GET 'https://magento2.winkelstraat.mac/rest/all/V1/products/{sku}/media'
Response examples (200)
[
  {
    "id": 42,
    "media_type": "string",
    "label": "string",
    "position": 42,
    "disabled": true,
    "types": [
      "string"
    ],
    "file": "string",
    "content": {
      "base64_encoded_data": "string",
      "type": "string",
      "name": "string"
    },
    "extension_attributes": {
      "video_content": {
        "media_type": "string",
        "video_provider": "string",
        "video_url": "string",
        "video_title": "string",
        "video_description": "string",
        "video_metadata": "string"
      }
    }
  }
]
Response examples (200)
<?xml version="1.0" encoding="UTF-8"?>
<root type="array">
  <root>
    <id type="integer">42</id>
    <media-type>string</media-type>
    <label>string</label>
    <position type="integer">42</position>
    <disabled type="boolean">true</disabled>
    <types type="array">
      <type>string</type>
    </types>
    <file>string</file>
    <content>
      <base64-encoded-data>string</base64-encoded-data>
      <type>string</type>
      <name>string</name>
    </content>
    <extension-attributes>
      <video-content>
        <media-type>string</media-type>
        <video-provider>string</video-provider>
        <video-url>string</video-url>
        <video-title>string</video-title>
        <video-description>string</video-description>
        <video-metadata>string</video-metadata>
      </video-content>
    </extension-attributes>
  </root>
</root>
Response examples (default)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (default)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <message>string</message>
  <errors type="array">
    <error>
      <message>string</message>
      <parameters type="array">
        <parameter>
          <resources>string</resources>
          <fieldName>string</fieldName>
          <fieldValue>string</fieldValue>
        </parameter>
      </parameters>
    </error>
  </errors>
  <code type="integer">42</code>
  <parameters type="array">
    <parameter>
      <resources>string</resources>
      <fieldName>string</fieldName>
      <fieldValue>string</fieldValue>
    </parameter>
  </parameters>
  <trace>string</trace>
</root>