title: How to make a request with PHPLeague oAuth2 client?
body: <p>I'm integrating with a affiliate platform for a client which provides an oAuth2 API, don't usually do massive amounts of work with oAuth2.</p>
  
  <p>I've decided for my client, I'll use the PHP Leagues oAuth2 package: <a href="https://github.com/thephpleague/oauth2-client" rel="nofollow">https://github.com/thephpleague/oauth2-client</a></p>
  
  <p>Anyway, I've got an accessToken no problem! using the following:</p>
  
  <pre><code>   $provider = new GenericProvider([
          'clientId' =&gt; $this-&gt;config-&gt;affiliates-&gt;rakuten-&gt;clientId,
          'clientSecret' =&gt; $this-&gt;config-&gt;affiliates-&gt;rakuten-&gt;clientSecret,
          'redirectUri' =&gt; 'http://www.newintoday.com/',
          'urlAuthorize' =&gt; 'https://api.rakutenmarketing.com/token', // Ignore
          'urlAccessToken' =&gt; 'https://api.rakutenmarketing.com/token',
          'urlResourceOwnerDetails' =&gt; 'https://api.rakutenmarketing.com/' // Ignore
      ]);
  
      try {
          // Try to get an access token using the resource owner password credentials grant.
          $accessToken = $provider-&gt;getAccessToken('password', [
              'username' =&gt; $this-&gt;config-&gt;affiliates-&gt;rakuten-&gt;username,
              'password' =&gt; $this-&gt;config-&gt;affiliates-&gt;rakuten-&gt;password,
              'scope' =&gt; $this-&gt;config-&gt;affiliates-&gt;rakuten-&gt;publisherId,
          ]);
  
          $productSearchApiBaseUri = 'https://api.rakutenmarketing.com/productsearch/1.0';
  
          $request = $provider-&gt;getAuthenticatedRequest('GET', $productSearchApiBaseUri, $accessToken, [
              'body' =&gt; '?keyword=shirt',
          ]);
  
          \Utils::dump($provider-&gt;getResponse($request));
  
      } catch (IdentityProviderException $e) {
          echo $e-&gt;getMessage();
      }
  </code></pre>
  
  <p>My question is once we have the accessToken what do we use in it to make the request, I followed through the code and came up with the above but the API responds saying that the keyword is not specified? Is </p>
  
  <pre><code>$request = $provider-&gt;getAuthenticatedRequest('GET', $productSearchApiBaseUri, $accessToken, [
      'body' =&gt; 'keyword=shirt',
  ]);
  </code></pre>
  
  <p>The correct way to provide it with a GET variable?</p>
  
  <p>Thanks in advance.</p>