title: Add (Create) new sheet in spreadsheet using Google Sheet API
body: <p>I have tried below code to create new sheet inside spreadsheet, but it’s not working.</p>
  
  <pre><code>    $service = new Google_Service_Sheets($client);
  
      //pr($service);
      $spreadsheetId = ‘You spredsheet id’;
      $json_request_string = ‘{“requests”:[{“addSheet”: {“properties”: {“title”: “Project tasks”}}}]}’;
      //$requests = json_decode($json_request_string);
  
      // TODO: Assign values to desired properties of `requestBody`:
      $requestBody = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest();
      $requestBody-&gt;setRequests($json_request_string);
  
      $response = $service-&gt;spreadsheets-&gt;batchUpdate($spreadsheetId, $requestBody);
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>Request had invalid authentication credentials error</p>
  </blockquote>