title: "Empty Payload. JSON content expected" error calling Microsoft Graph (Guzzle & PHP)
body: <p>I am trying to call the Microsoft Graph API to reset a passcode on a device registered with Intune. Unfortunately when I go to make the call, I receive an error stating that the JSON Payload is empty. The specific endpoint does not require a JSON payload, in fact it says to not include a body at all.</p>
  
  <p>I attempted to add some JSON to see if that would satisfy the error, and I still receive the same error message.</p>
  
  <p>Here is the call I am making:</p>
  
  <pre><code>$client = new Client();
  
      try{
          $client-&gt;post('https://graph.microsoft.com/beta/managedDevices/12345resetPasscode', [
              'headers' =&gt; [
                  'Authorization' =&gt; 'Bearer 12345',
                  'Accept'        =&gt; 'application/json',
                  'Content-Type'  =&gt; 'application/json',
                  'json'          =&gt; json_encode(['hello' =&gt; 'world']),
              ]
          ]);
      } catch (\GuzzleHttp\Exception\ClientException $e) {
  
          dd($e-&gt;getResponse()-&gt;getBody()-&gt;getContents());
  
      }
  </code></pre>
  
  <p>Here is the error I am receiving: 
  "Bad Request: Empty Payload. JSON content expected."
  <a href="https://i.stack.imgur.com/gwwtJ.png" rel="nofollow noreferrer">https://i.stack.imgur.com/gwwtJ.png</a></p>
  
  <p>Here is the API Documentation I am working off: <a href="https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/intune_devicefe_manageddevice_resetpasscode" rel="nofollow noreferrer">https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/intune_devicefe_manageddevice_resetpasscode</a></p>
  
  <p>Using PHP 7 &amp; Guzzle 6</p>
  
  <p>Any help is appreciated!</p>