# Shopware API: Umsetzung Beispiel

**URL:** <https://forum.shopware.com/t/shopware-api-umsetzung-beispiel/14135>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [2. Juli 2013 um 20:53 UTC](https://forum.shopware.com/t/shopware-api-umsetzung-beispiel/14135 "2013-07-02T20:53:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmmichael](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@mmmichael](https://forum.shopware.com/u/mmmichael)\
**Post date:** [2. Juli 2013 um 20:53 UTC](https://forum.shopware.com/t/shopware-api-umsetzung-beispiel/14135/1 "2013-07-02T20:53:15Z")

</div>

Hallo, ich versuche aktuell das Beispiel aus dem Wiki umzusetzen und scheitere leider daran: ` $minimalTestArticle = array( 'name' =\> 'Turnschuh', 'active' =\> true, 'tax' =\> 19, 'supplier' =\> 'Turnschuh Inc.', 'categories' =\> array( array('id' =\> 15), ), 'mainDetail' =\> array( 'number' =\> 'turn' . uniqid(), 'prices' =\> array( array( 'customerGroupKey' =\> 'EK', 'price' =\> 999, ), ) ), ); $result = $this-\>getApiClient()-\>post('articles', $minimalTestArticle); $id = $result['data']['id']; echo $id; $updateArticle = array( 'configuratorSet' =\> array( 'groups' =\> array( array( 'name' =\> 'Groesse', 'options' =\> array( array('name' =\> 'S'), array('name' =\> 'M'), array('name' =\> 'L'), array('name' =\> 'XL'), array('name' =\> 'XXL'), ) ), array( 'name' =\> 'Farbe', 'options' =\> array( array('name' =\> 'Weiß'), array('name' =\> 'Gelb'), array('name' =\> 'Blau'), array('name' =\> 'Schwarz'), array('name' =\> 'Rot'), ) ), ) ), 'taxId' =\> 1, 'variants' =\> array( array( 'isMain' =\> true, 'number' =\> 'turn', 'inStock' =\> 15, 'addtionnaltext' =\> 'L / Schwarz', 'configuratorOptions' =\> array( array('group' =\> 'Groesse', 'option' =\> 'L'), array('group' =\> 'Farbe', 'option' =\> 'Schwarz'), ), 'prices' =\> array( array( 'customerGroupKey' =\> 'EK', 'price' =\> 1999, ), ) ), array( 'isMain' =\> false, 'number' =\> 'turn.1', 'inStock' =\> 15, 'addtionnaltext' =\> 'S / Schwarz', 'configuratorOptions' =\> array( array('group' =\> 'Groesse', 'option' =\> 'S'), array('group' =\> 'Farbe', 'option' =\> 'Schwarz'), ), 'prices' =\> array( array( 'customerGroupKey' =\> 'EK', 'price' =\> 999, ), ) ), array( 'isMain' =\> false, 'number' =\> 'turn.2', 'inStock' =\> 15, 'addtionnaltext' =\> 'S / Rot', 'configuratorOptions' =\> array( array('group' =\> 'Groesse', 'option' =\> 'S'), array('group' =\> 'Farbe', 'option' =\> 'Rot'), ), 'prices' =\> array( array( 'customerGroupKey' =\> 'EK', 'price' =\> 999, ), ) ), array( 'isMain' =\> false, 'number' =\> 'turn.3', 'inStock' =\> 15, 'addtionnaltext' =\> 'XL / Rot', 'configuratorOptions' =\> array( array('group' =\> 'Groesse', 'option' =\> 'XL'), array('group' =\> 'Farbe', 'option' =\> 'Rot'), ), 'prices' =\> array( array( 'customerGroupKey' =\> 'EK', 'price' =\> 999, ), ) ) ) ); $this-\>getApiClient()-\>put('articles/' . $id, $updateArticle); ` Quelle: [http://wiki.shopware.de/Shopware-4-API- … 0\_869.html](http://wiki.shopware.de/Shopware-4-API-Beispiele-und-Erweiterungen%5C_detail%5C_1070%5C_869.html) Die einzige Änderung, die ich gemacht habe ist die „Größe“ =\> „Groesse“, damits nicht an irgendeinem Kodierungsproblem scheitert. Als Fehlermeldung erhalte ich: [quote] HTTP: 201 Success Array ( [id] =\> 280 [location] =\> [http://xxxxxx/shopware/api/articles/280](http://xxxxxx/shopware/api/articles/280) ) HTTP: 500 No Success Errormesage: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‚name‘ cannot be null [/quote] Ideen? Gruß, Michael

---

<div class="post-metadata">

**Author:** ![SebastianKloepper](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sebastiankloepper/32/21435_2.png) [@SebastianKloepper](https://forum.shopware.com/u/SebastianKloepper)\
**Post date:** [2. Juli 2013 um 21:28 UTC](https://forum.shopware.com/t/shopware-api-umsetzung-beispiel/14135/2 "2013-07-02T21:28:18Z")

</div>

Hallo, ich glaube in unserem Beispiel hat sich ein Schreibfehler eingeschlichen. addtionnaltext ist falsch geschrieben. Ein n zu viel. Pass das mal an und prüfe es dann erneut Sebastian

---

<div class="post-metadata">

**Author:** ![mmmichael](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@mmmichael](https://forum.shopware.com/u/mmmichael)\
**Post date:** [3. Juli 2013 um 09:20 UTC](https://forum.shopware.com/t/shopware-api-umsetzung-beispiel/14135/3 "2013-07-03T09:20:36Z")

</div>

Hallo Sebastian, hatte den Grund noch gefunden! Das Problem war das ‘Weiß’, also das übersehene Sonderzeichen. Nachdem ich das ersetzt hatte lief alles! Der Schreibfehler hatte hier nicht für Probleme gesorgt. Generell zur API: Gibts dazu eine abschließende Dokumentation? Gruß, Michael
