# REST API Customer Attribute filtern / leftJoin fehlt

**URL:** <https://forum.shopware.com/t/rest-api-customer-attribute-filtern-leftjoin-fehlt/60950>\
**Category:** Programmierung\
**Created:** [8. August 2019 um 14:57 UTC](https://forum.shopware.com/t/rest-api-customer-attribute-filtern-leftjoin-fehlt/60950 "2019-08-08T14:57:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fezzzzy](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@Fezzzzy](https://forum.shopware.com/u/Fezzzzy)\
**Post date:** [8. August 2019 um 14:57 UTC](https://forum.shopware.com/t/rest-api-customer-attribute-filtern-leftjoin-fehlt/60950/1 "2019-08-08T14:57:47Z")

</div>

Hallo,

weiß jemand wie man in der API nach den Customer Attributen (Kunden Freitext) filtern kann? Laut Doku müsste es doch eigentlich so funktionieren?

Es geht um eine Checkbox. Datenbankname ist ebenfalls ‚freitext‘ (als Beispiel)

```
$params = [
    'filter' => [
        [
            'property' => 'customer.attribute',
            'freitext' => '1'
        ]
    ]
];

```

Fehlermeldung:

```
HTTP: 500
No Success
Error message: A single-valued association path expression to an inverse side is not supported in DQL queries. Use an explicit join instead.

```

&nbsp;

Danke!

---

<div class="post-metadata">

**Author:** ![shyim](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/shyim/32/7681_2.png) [@shyim](https://forum.shopware.com/u/shyim)\
**Post date:** [8. August 2019 um 17:46 UTC](https://forum.shopware.com/t/rest-api-customer-attribute-filtern-leftjoin-fehlt/60950/2 "2019-08-08T17:46:48Z")

</div>

‘property’ =\> ‘customer.attribute.MeinAttributeName’,  
‘value’ =\> ‘MEIN WERT’

---

<div class="post-metadata">

**Author:** ![Fezzzzy](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@Fezzzzy](https://forum.shopware.com/u/Fezzzzy)\
**Post date:** [8. August 2019 um 21:02 UTC](https://forum.shopware.com/t/rest-api-customer-attribute-filtern-leftjoin-fehlt/60950/3 "2019-08-08T21:02:46Z")

</div>

Danke für die Antwort Shyim!

Dann erhalte ich jedoch folgenden Fehler:

```
HTTP: 500
No Success
Error message: [Semantical Error] line 0, col 89 near 'MeinAttributeName LIKE': Error: Class Shopware\Models\Customer\Customer has no field or association named attribute.MeinAttributeName

```

Cache mehrfach gelöscht und Model neu generiert.

Meine Abfrage ist folgende:

```
$client->get('customers', $params);

```

&nbsp;

Eine Put action funktioniert jedoch problemlos mit folgendem Code:

```
$client->put('customers/1', array(
    'attribute' => array(
      'MeinAttributeName' => '0'
    ),

));

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![Fezzzzy](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@Fezzzzy](https://forum.shopware.com/u/Fezzzzy)\
**Post date:** [9. August 2019 um 09:11 UTC](https://forum.shopware.com/t/rest-api-customer-attribute-filtern-leftjoin-fehlt/60950/4 "2019-08-09T09:11:11Z")

</div>

Okay scheinbar ist dies wohl standardmäßig nicht vorgesehen, schade.

Folgender Issue beschreibt&nbsp; das Problem, wären doch vermutlich nur 2 Sekunden Arbeit für das nächste Update?

[https://issues.shopware.com/issues/SW-20937?search=api%20attribute&status=1,3,10001,4,10010,10025,10017](https://issues.shopware.com/issues/SW-20937?search=api%20attribute&status=1,3,10001,4,10010,10025,10017)

&nbsp;

Übergangslösung wäre:

Plugin:&nbsp;[https://developers.shopware.com/developers-guide/rest-api/extend-api-resource/#search-results](https://developers.shopware.com/developers-guide/rest-api/extend-api-resource/#search-results)

API Filter:  
&nbsp;

```
$params = [
    'filter' => [
        [
            'property' => 'attribute.meinfreitextfeld',
			'value' => '1'
        ]
    ]
];

$client->get('customers', $params);

```

&nbsp;
