Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I delete a spreadsheet file using Google Spreadsheets API?

I can easily create one, update it, and access it with no problems but there doesn't seem to be an API call to delete it? You can delete sheets from the file but not the file itself?

I tried using google drive scopes, however, when I try to list files or delete them, I keep receiving a (403) Forbidden error.

like image 359
Scorpio Avatar asked Oct 18 '25 15:10

Scorpio


1 Answers

AFAIK and as explicitly stated in the documentation, Google Sheets API (formerly Google Spreadsheets API) gives you full control over the content and appearance of your spreadsheet data.

This API is useful for:

  • Managing the worksheets in a Google Sheets file
  • Consuming the rows of a worksheet
  • Managing cells in a worksheet by position

Note that your spreadsheets and your other Google docs are all stored in Google Drive. So, to delete files, you should be using Files: delete method of Google Drive API.

Tried this with the Try-it and my dummy sheet file was deleted with a 204 response (means delete successful).

like image 199
Teyam Avatar answered Oct 20 '25 16:10

Teyam