Search code examples
google-docs-apigoogle-drive-api

Documents deleted using Google Docs API still visible in Google Drive


I've built an integration using the Google Docs API (using GData) allowing users to create/edit documents from another application. Originally, when documents were deleted we would have them permanently deleted. They were no longer visible in Google Docs or Google Drive. Now when they are deleted using the Google Docs API, they are still present in the list of Documents in Google Drive. When you attempt to follow the link to the document you arrive at the "Sorry, the page (or document) you have requested does not exist." page.

Does Google Drive not honor the actions taken via the Google Docs API? Do I need to delete these documents using both the Google Docs API and the Google Drive API? What if the user has not migrated to Google Drive? Is there a way to tell if the have migrated? Or do I force them to migrate so I can use the Google Drive API to keep their Google Drive clean of these dead documents?


Solution

  • The Drive API and the Docs List API both operate on the same resources so you only have to use one of them (and we recommend the former).

    With the Drive API you can trash or delete files. When you trash a file, it will still be listed in Google Drive with a label to mark it as in trash, so that you can still untrash it.

    If you want to remove a file completely, you have to use the delete method.