# Update Artikel REST Api schlägt fehl - Validation Error

**URL:** <https://forum.shopware.com/t/update-artikel-rest-api-schlagt-fehl-validation-error/41842>\
**Category:** Programmierung\
**Created:** [30. November 2016 um 12:51 UTC](https://forum.shopware.com/t/update-artikel-rest-api-schlagt-fehl-validation-error/41842 "2016-11-30T12:51:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mobilize](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@mobilize](https://forum.shopware.com/u/mobilize)\
**Post date:** [30. November 2016 um 12:51 UTC](https://forum.shopware.com/t/update-artikel-rest-api-schlagt-fehl-validation-error/41842/1 "2016-11-30T12:51:39Z")

</div>

Hallo,

das Update über die RestAPI schlägt mit einem Validation Error fehl, aus merkwürdigem Grund, zB:

$art\_id=1234;

$result=$client-\>put(‚articles/‘.$art\_id, array(  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;‚categories‘ =\> array(  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(‚id‘ =\> ‚539‘)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;));

sollte die Kategorie 539 zum Artikel 1234 hinzufügen.

Meldung ist jedoch, dass dieses nicht möglich sei, weil Name, TAX etc fehlen.  
Der Artikel ist jedoch vorhanden.

Fehlermeldung:  
array(2) { [„success“]=\> bool(true) [„data“]=\> array(1) { [„categories“]=\> array(3) { [„success“]=\> bool(false) [„message“]=\> string(389) „Object(Shopware\Models\Article\Article).name: This value should not be blank. (code c1051bb4-d103-4f74-8988-acbcafc7fdc3) Object(Shopware\Models\Article\Article).tax: This value should not be blank. (code c1051bb4-d103-4f74-8988-acbcafc7fdc3) Object(Shopware\Models\Article\Article).mainDetail.number: This value should not be blank. (code c1051bb4-d103-4f74-8988-acbcafc7fdc3)“ [„trace“]=\> string(3041) "#0 /var/www/vhosts/atom124.lcube-server.de/shopware.atom124.lcube-server.de/engine/Shopware/Components/Api/Resource/Resource.php(527): …  
…  
Hat jemand eine Idee

---

<div class="post-metadata">

**Author:** ![janhofmann](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@janhofmann](https://forum.shopware.com/u/janhofmann)\
**Post date:** [15. April 2020 um 20:13 UTC](https://forum.shopware.com/t/update-artikel-rest-api-schlagt-fehl-validation-error/41842/2 "2020-04-15T20:13:28Z")

</div>

hello,

habe das selbe Problem aber noch keine Lösung gefunden!

Bist Du&nbsp;weiter gekommen?&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![sacrofano](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sacrofano](https://forum.shopware.com/u/sacrofano)\
**Post date:** [20. April 2020 um 09:47 UTC](https://forum.shopware.com/t/update-artikel-rest-api-schlagt-fehl-validation-error/41842/3 "2020-04-20T09:47:12Z")

</div>

Hallo,

du musst zusätzlich noch die id und number übergeben. Am Beispiel von [REST API - Article Resource](https://developers.shopware.com/developers-guide/rest-api/api-resource-article/#delete-(stack)) wird das klar. Aus der Doku zu put, geht das nicht eindeutig hervor.

---

<div class="post-metadata">

**Author:** ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)\
**Post date:** [20. April 2020 um 10:42 UTC](https://forum.shopware.com/t/update-artikel-rest-api-schlagt-fehl-validation-error/41842/4 "2020-04-20T10:42:09Z")

</div>

Also ich weis jetzt nicht wo das Problem ist, aber das Beispiel von ganz oben (wobei 3 Jahre alt) ist so korrekt! Zum Updaten der Kategorie braucht man hier nicht mehr.
