Create Folder

Last Updated: Nov 26, 2021


Use this function to create a new folder inside a parent folder.


Create Folder (folder_name, parent_folder_id, private_key, client_email)


Input Parameter Name Description
folder_name Name of the folder to be created
parent_folder_id Parent folder ID in which the subfolder has to be created
private_key Private key of the service account
client_email Email ID of the service account


Return Value Description
  • On Success returns 1, Folder ID
  • On Failure returns 0, Error Message


Create Folder (Invoices, ABC123, —–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, creates a folder Invoice in the parent folder with ID ABC123.
    Returns the Folder ID of the folder created.

To view all the Google Drive functions, click here.

Did you find what you were looking for?