# Php api error

**URL:** <https://discuss.elastic.co/t/php-api-error/226673>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [April 6, 2020, 10:11am UTC](https://discuss.elastic.co/t/php-api-error/226673 "2020-04-06T10:11:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vipinpa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vipinpa/32/65725_2.png) [@vipinpa](https://discuss.elastic.co/u/vipinpa)\
**Post date:** [April 6, 2020, 10:11am UTC](https://discuss.elastic.co/t/php-api-error/226673/1 "2020-04-06T10:11:26Z")

</div>

Hi,

I am using PHP elastic api ([https://github.com/elastic/app-search-php](https://github.com/elastic/app-search-php))

## I passed the filter param like below.

$searchParams = [  
'page' =\> ['current' =\> $current, 'size' =\> 10] ,  
'filters'=\> [  
'all' =\> [  
"search\_type" =\> ["company"],  
"company\_type" =\> ["Distributor","Music Publisher"]  
]  
]

```
	];

```

* * *

I am getting error " **error** : Uncaught Elastic\OpenApi\Codegen\Exception\BadRequestException: Filters contains an invalid set of keys for object inside of field: all; can only have clauses or a single field name.

Could you please help.

Thanks,  
Vipin

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 4, 2020, 10:11am UTC](https://discuss.elastic.co/t/php-api-error/226673/2 "2020-05-04T10:11:26Z")

</div>

Closed on May 4, 2020, 10:11am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
