# coverId von Artikel abfragen mit Enischränkung über includes

**URL:** <https://forum.shopware.com/t/coverid-von-artikel-abfragen-mit-enischrankung-uber-includes/67650>\
**Category:** Shopware Playground - API first Sandbox\
**Created:** [14. Juni 2020 um 20:44 UTC](https://forum.shopware.com/t/coverid-von-artikel-abfragen-mit-enischrankung-uber-includes/67650 "2020-06-14T20:44:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bugfree](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/bugfree/32/13827_2.png) [@bugfree](https://forum.shopware.com/u/bugfree)\
**Post date:** [14. Juni 2020 um 20:44 UTC](https://forum.shopware.com/t/coverid-von-artikel-abfragen-mit-enischrankung-uber-includes/67650/1 "2020-06-14T20:44:51Z")

</div>

Ich versuche Response von api/v1/search/product mitteld includes zu beschränken, um die coverId des Hauptbildes eines Artikels zu erhalten:

```
$aPostData = [
  'ids' => [$productId],
  'includes' => [
    'product' => ['id'],
    'media' => ['coverId']
  ]
]

```

Der Artikel wird gefunden, jedoch sind keine media-Angaben mit drin ☹

---

<div class="post-metadata">

**Author:** ![bugfree](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/bugfree/32/13827_2.png) [@bugfree](https://forum.shopware.com/u/bugfree)\
**Post date:** [14. Juni 2020 um 21:22 UTC](https://forum.shopware.com/t/coverid-von-artikel-abfragen-mit-enischrankung-uber-includes/67650/2 "2020-06-14T21:22:02Z")

</div>

Habs rausgefunden =)

```
$aPostData = [
  'ids' => [$productId],
  'includes' => [
    'product' => ['id','coverId']
  ]
]

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![bugfree](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/bugfree/32/13827_2.png) [@bugfree](https://forum.shopware.com/u/bugfree)\
**Post date:** [15. Juni 2020 um 14:38 UTC](https://forum.shopware.com/t/coverid-von-artikel-abfragen-mit-enischrankung-uber-includes/67650/3 "2020-06-15T14:38:42Z")

</div>

Soweit so gut … und jetzt versuche ich die Response von (POST) **api/v1/media** mittels includes auf die neu erzeugte mediaId zu beschränken:

```
$postData = [
  'mediaFolderId' => $this->mediaFolderId,
  'includes' => ['id']
];

```

Leider klappt das nicht, es kommt der ganze Datensatz, ich benötige jedoch nur die neu erzeuge mediaId.

Kann jemand helfen?
