I tried using an example from Google Drive. So the code:
var request = gapi.client.drive.files.delete({
'fileId' : someFileId
});
request.execute(function(resp)
{
console.log(resp);
});
The application is installed correctly, and I use the drive.file area. The problem is that the file is not deleted. It is still present in the disk interface and can no longer be opened or loaded. The file is damaged.
The request sent is not DELETE https://www.googleapis.com/drive/v2/files/fileId , as indicated in the docs. This is the POST https://www.googleapis.com/rpc?key=API_KEY . The body contains a JSON array:
[{"jsonrpc":"2.0","id":"gapiRpc","method":"drive.files.delete","params":{"fileId":"someFileId"},"apiVersion":"v2"}]
The response contains one empty JSON object. There are no errors in the response, and no JS errors on the page. API Explorer successfully deletes the file.
Any clues?
source
share