Search

Delete Document

Last Updated: May 27, 2021

Articles

Use this function to delete a Google Doc from the drive.

Syntax

Delete Document (document_id, private_key, client_email)

Parameters

Input Parameter Name Description
document_id Name of the document
private_key Private key of the service account
client_email Email ID of the service account

Returns

Return Value Description
Output
  • On Success returns 1, Document deleted successfully
  • On Failure returns 0, Error Message

Sample

Delete Document (XYZ123, —–BEGIN PRIVATE KEY—–\nABCD\n—–END PRIVATE KEY—–, name@project-id.iam.gserviceaccount.com)

  • Uses the private key —–BEGIN PRIVATE KEY—–\nABCD\n—–END PRIVATE KEY—– to connect to the Email ID name@project-id.iam.gserviceaccount.com, deletes the Google Doc with ID XYZ123.
    Returns Document deleted successfully after deleting the document.

To view all the Google Docs functions, click here.

Did you find what you were looking for?