# REST API Doku und Column media\_id cannot be null

**URL:** <https://forum.shopware.com/t/rest-api-doku-und-column-media-id-cannot-be-null/73037>\
**Category:** Programmierung\
**Created:** [26. Februar 2021 um 11:28 UTC](https://forum.shopware.com/t/rest-api-doku-und-column-media-id-cannot-be-null/73037 "2021-02-26T11:28:08Z")\
**Posts on this page:** 1\
**Page:** 1

<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:** [26. Februar 2021 um 11:28 UTC](https://forum.shopware.com/t/rest-api-doku-und-column-media-id-cannot-be-null/73037/1 "2021-02-26T11:28:08Z")

</div>

Über eine Stunde habe ich über eine Fehlermeldung aus der REST API nach der Ursache gesucht:

```
Error message: An exception occurred while executing 
'INSERT INTO s_article_configurator_options (group_id, name, position, media_id) VALUES (?, ?, ?, ?)' with params [8, "50 mm x 100 m", 0, null]:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'media_id' cannot be null

```

Diese Fehlermeldung muss neu sein, denn vor einiger Zeit kam diese nicht, wenn man bei einem Artikel auch die Optionen (configuratorSet) mit übergeben will. Laut Shopware Doku und Beispielen

=\> [REST API - Examples using the article resource](https://developers.shopware.com/developers-guide/rest-api/examples/article/)

sieht das **Array configuratorSet** so aus:

```
Array
(
    [groups] => Array
        (
            [0] => Array
                (
                    [name] => Ausführung
                    [options] => Array
                        (
                            [50 mm x 100 m] => Array
                                (
                                    [name] => 50 mm x 100 m
                                )

                        )

                )

        )

)

```

Geht natürlich nicht mehr, weil es jetzt so aussehen muss:

```
Array
(
    [groups] => Array
        (
            [0] => Array
                (
                    [name] => Ausführung
                    [options] => Array
                        (
                            [50 mm x 100 m] => Array
                                (
                                    [name] => 50 mm x 100 m
                                    [mediaId] => 0
                                )

                        )

                )

        )

)

```

Wäre schon wenn die Shopware Doku bzw. die Beispiele auch mal auf aktuellen Stand gebracht werden, ohne das User aus dem Forum darauf hinweisen müssen.

&nbsp;
