# PHP Guzzle article suche/Anpassen/erstellen

**URL:** <https://forum.shopware.com/t/php-guzzle-article-suche-anpassen-erstellen/68271>\
**Category:** Sonstiges\
**Created:** [10. Juli 2020 um 10:44 UTC](https://forum.shopware.com/t/php-guzzle-article-suche-anpassen-erstellen/68271 "2020-07-10T10:44:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hagrim](https://avatars.discourse-cdn.com/v4/letter/h/cdc98d/32.png) [@hagrim](https://forum.shopware.com/u/hagrim)\
**Post date:** [10. Juli 2020 um 10:44 UTC](https://forum.shopware.com/t/php-guzzle-article-suche-anpassen-erstellen/68271/1 "2020-07-10T10:44:16Z")

</div>

Hallo,

ich bin gestartet mit&nbsp;ein Schnittstelle&nbsp;um Produkten zu andern mit&nbsp;REST-API.&nbsp;Habe bereits vieles gelesen, aber dass meiste ist&nbsp;fur&nbsp;ShopWare&nbsp;5 zu finden. Hat jemand&nbsp;ein Beispiel&nbsp;im&nbsp;PHP&nbsp;mit&nbsp;Guzzle&nbsp;um Einen Produkt zu andern. Ich bin interessiert in&nbsp;PHP&nbsp;Beispielen:

1.&nbsp;Aricle&nbsp;suchen

2.&nbsp;article&nbsp;updaten.

Einloggen im System funktioniert:

```
 &nbsp;

<?php </pre>

     error\_reporting(E\_ALL); ini\_set('display\_errors', 1); require\_once '../../vendor/autoload.php'; use GuzzleHttp\Client; $client = new GuzzleHttp\Client(['base\_uri' =\> 'https://server.nl', 'timeout' =\> 2.0, 'headers' =\> ['Content-Type' =\> 'application/json'], 'verify' =\> false, ]); $clientId = "<id>";
     $clientSecret = "<secret>";
    
    $body = json_encode([
                'client_id' =&gt; $clientId,
                'client_secret' =&gt; $clientSecret,
                'grant_type' =&gt; 'client_credentials',
    			'scopes' =&gt; 'write',
            ]);
    
    $response = $client-&gt;post(
                '/api/oauth/token',
                [
                    'Content-Type' =&gt; 'application/json',
                    'body' =&gt; $body
                ]
            );
    $token = json_decode($response-&gt;getBody()-&gt;getContents(), true);
    print_r($token);</secret></id>

?\>
```
