Google Sheets Api: Copy google spreadsheet
<p>Trying to copy a whole spreadsheet but I guess there is no api to do so.</p>

<p>Basically, I am trying to do the following:</p>

<ul>
<li>Have a spreadsheet which I would like to duplicate with minor changes.</li>
<li>Create a new spreadsheet, copy all sheets from a template into the new spreadsheet one by one (Spreadsheet copy would have been much more efficient)</li>
</ul>

<p>Creating new spreadsheets works alright however, copying sheets from spreadsheet doesn't work.</p>

<p>Tried 2 ways:</p>

<p><strong>Angular:</strong></p>

<pre><code>$http.post("https://sheets.googleapis.com/v4/spreadsheets/"+fromSpreadsheetId+"/sheets/"+fromSheetId,
                            {headers: {
                        'Authorization': 'Bearer ' + this.oauthToken
                     }},
</code></pre>

<p>Gives following error:</p>

<blockquote>
  <p>Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin'</p>
</blockquote>

<p><strong>Google Sheets Api call:</strong></p>

<pre><code>gapi.client.sheets.spreadsheets.sheets.copyTo({spreadsheetId: fromSpreadsheetId , sheetId: fromSheetId},{destinationSpreadsheetId: destinationSpreadsheetId});
</code></pre>

<p>Request goes through without any error. However, the newly created spreadsheet doesn't have the sheet copied.</p>