Skip to main content

Copy object

Copies file or directory

Function CopyObject(Val Token, Val Identifier, Val NewName = "", Val NewParent = "") Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Identifier--objectStringObject identifier
NewName--titleStringNew object name
NewParent--catalogStringNew parent directory

Returns: Map Of KeyAndValue - serialized JSON response from Google


1C:Enterprise/OneScript code example
    Token      = "ya29.a0AcM612wmWdggP-K6tOc3UqW0KxYMjUi60_Uhu-ERltTaavHGbML0nRBXqkuiBcr0GNmR_1gHKowaF1Rd_4Q5Amc9O23DEBZ95sNEGnpR5...";
Identifier = "1Uw6seoqvBcqUeIFLkklWn8ZNBc6nQkpY";
NewName = "CopiedFile.jpeg";
NewParent = "root";

Result = OPI_GoogleDrive.CopyObject(Token, Identifier, NewName, NewParent);
    oint gdrive CopyObject \
--token "***" \
--object "1MgRgtXCENs_8VuQjX6WFY7s6Yv9RoaJV" \
--title "CopiedFile.jpeg" \
--catalog "root"
Result
{
"kind": "drive#file",
"id": "19rwnmeC5Vro9P_yBfeKsPLeuSOU9Y9oC",
"name": "CopiedFile.jpeg",
"mimeType": "image/jpeg"
}