# Bilder per API an Shopware

**URL:** <https://forum.shopware.com/t/bilder-per-api-an-shopware/51695>\
**Category:** Shopware 5\
**Created:** [12. März 2018 um 12:00 UTC](https://forum.shopware.com/t/bilder-per-api-an-shopware/51695 "2018-03-12T12:00:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![beauty1](https://avatars.discourse-cdn.com/v4/letter/b/7cd45c/32.png) [@beauty1](https://forum.shopware.com/u/beauty1)\
**Post date:** [12. März 2018 um 12:00 UTC](https://forum.shopware.com/t/bilder-per-api-an-shopware/51695/1 "2018-03-12T12:00:39Z")

</div>

Hallo,

wir übertragen per API die Produktbilder an Shopware, leider werden bei den Varianten das erste Bild nicht als Vorschaubild gesetzt. Gibt es eine Lösung? Vielen Dank

 ![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/4/4e7f962d660f8724c2c1f7cba33caceef9b3a616.jpeg)

> wird put auf articles:
> 
> Array  
> (  
> [configuratorSet] =\> Array  
> (  
> [groups] =\> Array  
> (  
> [0] =\> Array  
> (  
> [name] =\> Inhalt Variante  
> [options] =\> Array  
> (  
> [0] =\> Array  
> (  
> [name] =\> 100ml  
> )
> 
> [1] =\> Array  
> (  
> [name] =\> 10ml  
> )
> 
> )
> 
> )
> 
> )
> 
> )
> 
> [taxId] =\> 1  
> [variants] =\> Array  
> (  
> [0] =\> Array  
> (  
> [isMain] =\> 1  
> [number] =\> 44732  
> [referenceUnit] =\> 100.0000  
> [purchaseUnit] =\> 100.0000  
> [packUnit] =\> 0  
> [ean] =\> 4001638500777  
> [supplierNumber] =\> 951100x  
> [unitId] =\> 1  
> [pid] =\> 7559  
> [additionaltext] =\> 100ml  
> [width] =\> 60  
> [height] =\> 138  
> [len] =\> 37  
> [weight] =\> 0.2760  
> [shippingTime] =\> 1  
> [shippingFree] =\> 0  
> [purchasePrice] =\> 7.03  
> [stockMin] =\> 0.0000  
> [minPurchase] =\> 1.0000  
> [maxPurchase] =\>  
> [configuratorOptions] =\> Array  
> (  
> [0] =\> Array  
> (  
> [group] =\> Inhalt Variante  
> [option] =\> 100ml  
> )
> 
> )
> 
> [prices] =\> Array  
> (  
> [0] =\> Array  
> (  
> [customerGroupKey] =\> EK  
> [from] =\> 1  
> [to] =\> beliebig  
> [percent] =\> 0  
> [price] =\> 14.95  
> [pseudoPrice] =\> 0  
> [basePrice] =\> 7.03  
> )
> 
> )
> 
> [attribute] =\> Array  
> (  
> [emzNotificationsEmailNotificiation] =\> 0  
> [emzNotificationsSale] =\> 0  
> [lenzGoogleShoppingCategory] =\> 567  
> [lenzGoogleShoppingActive] =\> 1  
> [lenzGoogleShoppingTitle] =\>  
> [lenzGoogleShoppingDescription] =\>  
> [lenzGoogleShoppingCondition] =\> new  
> )
> 
> [active] =\> 1  
> [\_\_options\_images] =\> Array  
> (  
> [replace] =\> 1  
> )
> 
> [images] =\> Array  
> (  
> [0] =\> Array  
> (  
> [mediaId] =\> 385740  
> [position] =\> 1  
> [main] =\> 1  
> )
> 
> )
> 
> )
> 
> [1] =\> Array  
> (  
> [isMain] =\> 0  
> [number] =\> 008900M1  
> [referenceUnit] =\> 100.0000  
> [purchaseUnit] =\> 10.0000  
> [packUnit] =\> 0  
> [ean] =\> 4001638089005  
> [supplierNumber] =\> 008900M1  
> [unitId] =\> 1  
> [pid] =\> 7560  
> [additionaltext] =\> 10ml  
> [width] =\> 0.000  
> [height] =\> 0.000  
> [len] =\> 0.000  
> [weight] =\> 0.0100  
> [shippingTime] =\> 1  
> [shippingFree] =\> 0  
> [purchasePrice] =\> 1.29  
> [stockMin] =\> 0.0000  
> [minPurchase] =\> 1.0000  
> [maxPurchase] =\>  
> [configuratorOptions] =\> Array  
> (  
> [0] =\> Array  
> (  
> [group] =\> Inhalt Variante  
> [option] =\> 10ml  
> )
> 
> )
> 
> [prices] =\> Array  
> (  
> [0] =\> Array  
> (  
> [customerGroupKey] =\> EK  
> [from] =\> 1  
> [to] =\> beliebig  
> [percent] =\> 0  
> [price] =\> 1.95  
> [pseudoPrice] =\> 0  
> [basePrice] =\> 1.29  
> )
> 
> )
> 
> [attribute] =\> Array  
> (  
> [emzNotificationsEmailNotificiation] =\> 1  
> [emzNotificationsSale] =\> 0  
> [lenzGoogleShoppingCategory] =\> 567  
> [lenzGoogleShoppingActive] =\> 1  
> [lenzGoogleShoppingTitle] =\>  
> [lenzGoogleShoppingDescription] =\>  
> [lenzGoogleShoppingCondition] =\> new  
> )
> 
> [active] =\> 1  
> [\_\_options\_images] =\> Array  
> (  
> [replace] =\> 1  
> )
> 
> [images] =\> Array  
> (  
> [0] =\> Array  
> (  
> [mediaId] =\> 379729  
> [position] =\> 2  
> [main] =\> 2  
> )
> 
> )
> 
> )
> 
> )
> 
> [\_\_options\_images] =\> Array  
> (  
> [replace] =\> 1  
> )
> 
> )

---

<div class="post-metadata">

**Author:** ![alexanderkirk](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@alexanderkirk](https://forum.shopware.com/u/alexanderkirk)\
**Post date:** [12. März 2018 um 13:05 UTC](https://forum.shopware.com/t/bilder-per-api-an-shopware/51695/2 "2018-03-12T13:05:57Z")

</div>

Hallo,

hiermit sollte es klappe:

```
create(array(
		// ...
		'images' => array(
			// ...
			array(
				'link' => 'https://www.google.de/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png'
				'description'	=> 'Google Logo'
				'main' => true
			),
			array(
				'link' => 'https://www.shopwaredemo.de/media/image/b9/d3/e1/logo-desk.png'
				'description'	=> 'Shopware Demo',
				'main' => false
			),
			// ...
		),
		// ...
	));

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![beauty1](https://avatars.discourse-cdn.com/v4/letter/b/7cd45c/32.png) [@beauty1](https://forum.shopware.com/u/beauty1)\
**Post date:** [15. März 2018 um 11:42 UTC](https://forum.shopware.com/t/bilder-per-api-an-shopware/51695/3 "2018-03-15T11:42:19Z")

</div>

Hallo,

danke für den Lösungsansatz es klappt jedoch nicht, der Schnittstellenentenwickler hat das Script so eingebaut jedoch werden dann keine Bilder mehr übertragen.  
Haben wir eine Chance uns das dir das mal anschauen kannst?

&nbsp;

---

<div class="post-metadata">

**Author:** ![dhoelter](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@dhoelter](https://forum.shopware.com/u/dhoelter)\
**Post date:** [15. März 2018 um 12:00 UTC](https://forum.shopware.com/t/bilder-per-api-an-shopware/51695/4 "2018-03-15T12:00:07Z")

</div>

Moin,

das Problem hatten wir auch mal.

Du musst im Knoten&nbsp;images was ändern.

//für das Main Bild

“images”: [{

“main”: “1”,

“position”: “1”,

//und für das zweite Bild

“main”:&nbsp;&nbsp; &nbsp;“2”, &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;

“position”:&nbsp;&nbsp; &nbsp;“2”,

Gruß!

---

<div class="post-metadata">

**Author:** ![beauty1](https://avatars.discourse-cdn.com/v4/letter/b/7cd45c/32.png) [@beauty1](https://forum.shopware.com/u/beauty1)\
**Post date:** [15. März 2018 um 12:22 UTC](https://forum.shopware.com/t/bilder-per-api-an-shopware/51695/5 "2018-03-15T12:22:43Z")

</div>

Moin,  
danke für den Tipp.

Das ist im Code schon so drin.

Gruß
