Search

Move File

Last Updated: May 10, 2022

Articles

Use this function to move a file in on Google Drive to the destination folder.

Syntax

Move File (file_id, destination, private_key, client_email)

Parameters

Input Parameter Name Description
file_id ID of the file
destination ID of the destination folder
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, ID of the moved file
  • On Failure returns 0, Error Message

Sample

Move File (XYZ123, ABC123, —–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, moves the file with ID XYZ123 to the destination folder with ID ABC123.
    Returns the ID of the moved file on moving the file.

To view all the Google Drive functions, click here.

Did you find what you were looking for?