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.a0AT3oNZ89Gfvy6_DUg_tviJJnmBXSmGRrPL6Vym5gPCsPQEa3F606plSWJttyabLz5gHJY63An6XG9wKNlbVK4fkTSF_KNhqT5M6IGUm8THO6IWF0iGzg5z2SO...";
Identifier = "1oUMoSImbl8NKBVWQE9zkBdJ0QIPrkhtb";
NewName = "CopiedFile.jpeg";
NewParent = "root";

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