# Images

To make use of images with Ucommerce, you will need to implement your image service based on the `IImageService` interface.

## Prerequisites

Before implementing your custom Image Service with Ucommerce, ensure the following:

* **External Data Source:** You need access and necessary permissions to fetch and format data from an external source and into Ucommerce. If you are using a CMS, you could consider using any asset management system implemented in that.

{% hint style="info" %}
A Digital Asset Management (DAM) system is highly recommended for efficient asset management and reliable functionality.
{% endhint %}

## IImageService

The `IImageService` interface provides three distinct methods for retrieving content. These methods cater to various use cases within the system.

1. **`Get` Method**

   This method is commonly used by the backoffice media picker and is designed to retrieve a list of content.

   * *Parameters:*
     * `parentId`: Filter the content based on the parent ID. Default is `null`.
     * `startAt`: Define the starting point for the retrieval. Default is 0.
     * `limit`: Set a limit on the number of content items to retrieve. Default is 30.
     * `token`: Cancellation token for task management. Default is `null`.
   * *Usage:*
     * The media picker relies on this method to:
       * Retrieve all content.
       * Initially (when no ID is set) obtain the first root folder in the list and then invoke the method again with this folder's ID as the root.
   * *Note:*
     * As a result, the first elements in the list should typically represent some form of root object.
2. **`GetById` Method**

   This method is designed to fetch image content by a specific ID.
3. **`GetByIds` Method**

   This method is intended to retrieve all content items associated with a list of specified IDs.

All of these methods should fetch and filter your data, based on your external data source.

## Related articles

{% content-ref url="/pages/njonZbrUttQXGAMloUEW" %}
[Media](/readme/miscellaneous/media.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.ucommerce.net/readme/extensions/change-service-behavior/images.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
