# Api Article Attribute updaten

**URL:** <https://forum.shopware.com/t/api-article-attribute-updaten/67779>\
**Category:** Programmierung\
**Created:** [18. Juni 2020 um 15:26 UTC](https://forum.shopware.com/t/api-article-attribute-updaten/67779 "2020-06-18T15:26:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [18. Juni 2020 um 15:26 UTC](https://forum.shopware.com/t/api-article-attribute-updaten/67779/1 "2020-06-18T15:26:10Z")

</div>

Hallo,

ich versuche Artikel-Attibute über die Api zu updaten, es regt sich nur nichts.

```
$client->put('articles/7941', array(
    'mainDetail' => array(
        'attribute' => array(
            'attr1' => 'test'
        )
    )
));

//oder auch

$client->put('articles/7941', array(
        'attribute' => array(
            'attr1' => 'test'
        )
));

```

Hat jemand eine Idee warum das nicht geht?

Danke und gruss

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [18. Juni 2020 um 15:33 UTC](https://forum.shopware.com/t/api-article-attribute-updaten/67779/2 "2020-06-18T15:33:20Z")

</div>

Edit: die zweite version macht er. habe mich in der Datenbanktabelle irritieren lassen

Die **main\_detail\_id** aus s\_articles ist die **id** , **articledetailsID** aus s\_articles\_attributes und nicht die **articleID** aus s\_articles\_detail. uff…

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [19. Juni 2020 um 11:45 UTC](https://forum.shopware.com/t/api-article-attribute-updaten/67779/3 "2020-06-19T11:45:05Z")

</div>

Ich habe doch noch eine Frage, Ich habe festfestellt, dass er die erste Version (mit mainDetail) und die zweite Version korrekt ausführt. Warum ist das so?
