Delete Content

Last Updated: May 10, 2022


Use this function to delete the text within the given indices in a Google Doc.


Delete Content (document_id, start_index, end_index, private_key, client_email)


Input Parameter Name Description
document_id Name of the document
start_index Starting index of text
end_index Ending index of text
private_key Private key of the service account
client_email Email ID of the service account


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


Delete Content (XYZ123, 2, 7, —–BEGIN PRIVATE KEY—–\nABCD\n—–END PRIVATE KEY—–,

  • Uses the private key —–BEGIN PRIVATE KEY—–\nABCD\n—–END PRIVATE KEY—– to connect to the Email ID, deletes the content between the indices 2 and 7 in the Google Doc with ID XYZ123.
    Returns Text deleted successfully after deleting the content.

To view all the Google Docs functions, click here.

Did you find what you were looking for?