# API - 400 Bad Request, Your browser sent a request that this server could not understand

**URL:** <https://forum.shopware.com/t/api-400-bad-request-your-browser-sent-a-request-that-this-server-could-not-understand/64533>\
**Category:** Programming (EN)\
**Created:** [7. Februar 2020 um 09:07 UTC](https://forum.shopware.com/t/api-400-bad-request-your-browser-sent-a-request-that-this-server-could-not-understand/64533 "2020-02-07T09:07:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronaksolanki10](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@ronaksolanki10](https://forum.shopware.com/u/ronaksolanki10)\
**Post date:** [7. Februar 2020 um 09:07 UTC](https://forum.shopware.com/t/api-400-bad-request-your-browser-sent-a-request-that-this-server-could-not-understand/64533/1 "2020-02-07T09:07:26Z")

</div>

Hello,

Thank you in advance.

&nbsp;

I am trying to get the manufacturer using the API. For example

> $queryString = ‚‘;  
> &nbsp; &nbsp; &nbsp; &nbsp; if (!empty($params)) {  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $queryString = http\_build\_query($params);  
> &nbsp; &nbsp; &nbsp; &nbsp; }  
> &nbsp; &nbsp; &nbsp; &nbsp; $url = rtrim($url, ‚?‘) . ‚?‘;  
> &nbsp; &nbsp; &nbsp; &nbsp; $url = $this-\>apiUrl . $url . $queryString;  
> &nbsp; &nbsp; &nbsp; &nbsp; $dataString = json\_encode($data);  
> &nbsp; &nbsp; &nbsp; &nbsp; curl\_setopt($this-\>cURL, CURLOPT\_URL, $url);  
> &nbsp; &nbsp; &nbsp; &nbsp; curl\_setopt($this-\>cURL, CURLOPT\_CUSTOMREQUEST, $method);  
> &nbsp; &nbsp; &nbsp; &nbsp; curl\_setopt($this-\>cURL, CURLOPT\_POSTFIELDS, $dataString);  
> &nbsp; &nbsp; &nbsp; &nbsp; curl\_setopt($this-\>cURL, CURLOPT\_USERAGENT,‚Mozilla/5.0 (X11; Linux x86\_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36‘);  
> &nbsp; &nbsp; &nbsp; &nbsp; curl\_setopt(  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-\>cURL,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CURLOPT\_HTTPHEADER,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚Content-Type &nbsp;: application/json;‘,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'Authorization : Bearer '.$this-\>accessToken  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]  
> &nbsp; &nbsp; &nbsp; &nbsp; );  
> &nbsp; &nbsp; &nbsp; &nbsp; $result = curl\_exec($this-\>cURL);
> 
> Also tried adding&nbsp;curl\_setopt($this-\>cURL, CURLOPT\_USERAGENT,‚Mozilla/5.0 (X11; Linux x86\_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36‘);, but still the same error and this api is working well in **postman**
