# Bildmapping per API

**URL:** <https://forum.shopware.com/t/bildmapping-per-api/47251>\
**Category:** Programmierung\
**Created:** [2. August 2017 um 11:47 UTC](https://forum.shopware.com/t/bildmapping-per-api/47251 "2017-08-02T11:47:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mctl](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mctl](https://forum.shopware.com/u/mctl)\
**Post date:** [2. August 2017 um 11:47 UTC](https://forum.shopware.com/t/bildmapping-per-api/47251/1 "2017-08-02T11:47:18Z")

</div>

Hallo zusammen,

mir macht gerade der Import von Variantenbildern per API etwas Kummer. Obwohl ich die Variantenkonfiguration so angelegt habe:

```
'configuratorSet' => array(
        'groups' => array(
            array(
                'name' => 'Kapazität',
                'options' => array(
                    array('name' => '1 L'),
                    array('name' => '2 L'),
                    array('name' => '5 L'),
                    array('name' => '10 L'),
                )
            ),
            array(
                'name' => 'Farbe',
                'options' => array(
                    array('name' => 'weiß'),
                    array('name' => 'blau'),
                    array('name' => 'rot'),
                    array('name' => 'schwarz'),
                    array('name' => 'Red'),
                )
            )
        )
   )

```

Und das Ganze auch problemlos funktioniert, bekomme ich die Bildzuordnung zu einer bestimmten Variante nicht über “images” hin:

```
'images' => array(
        array(
            'link' => 'http://www.irgendwo(...).jpg',
            'options' => array(
                array(
                    'name' => 'blau'
                )
            )
        )
   )

```

Als Ergebnis bekomme ich im Backend, im Artikel unter Bilder zwar das Variantenbild angezeigt, und auch, dass es sich um ein konfiguriertes Bild handelt, doch unter dem entsprechenden Reiter taucht nur eine leere - also unbenannte - Konfiguration auf. In ihr ist jedoch keine Zuordnung enthalten.

Offensichtlich stimmt also die Syntax nicht. Doch in der API-Doku finde ich es nicht genauer beschrieben. Weiß jemand, wie es richtig übergeben wird?

---

<div class="post-metadata">

**Author:** ![ThomasGG](https://avatars.discourse-cdn.com/v4/letter/t/dbc845/32.png) [@ThomasGG](https://forum.shopware.com/u/ThomasGG)\
**Post date:** [10. Dezember 2017 um 00:16 UTC](https://forum.shopware.com/t/bildmapping-per-api/47251/2 "2017-12-10T00:16:16Z")

</div>

Hallo, hast du es mittlerweile hinbekommen? Ich stehe vor genau dem selben Problem und weder die API noch das Forum hilft mir hier gerade weiter.;(

---

<div class="post-metadata">

**Author:** ![h\_lohaus](https://avatars.discourse-cdn.com/v4/letter/h/a587f6/32.png) [@h\_lohaus](https://forum.shopware.com/u/h_lohaus)\
**Post date:** [10. Dezember 2017 um 08:23 UTC](https://forum.shopware.com/t/bildmapping-per-api/47251/3 "2017-12-10T08:23:05Z")

</div>

Hi,

schau dir mal das Beispiel an:

&nbsp;[REST API - Examples using the media resource](https://developers.shopware.com/developers-guide/rest-api/examples/media/#the-configuration-for-image-assignment)

Es sind 3 "array"s verschachtelt.

Gruß Heiner
