﻿---
sidebar_position: 7
description: Copy object and other functions to work with Google Drive in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Google Drive]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Copy object
 Copies file or directory



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

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Token |
  | Identifier | --object | String | &#x2714; | Object identifier |
  | NewName | --title | String | &#x2716; | New object name |
  | NewParent | --catalog | String | &#x2716; | New parent directory |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Google

<br/>



```bsl title="1C:Enterprise/OneScript code example"
    Token      = "ya29.a0AQQ_BDTEToh-GItDaON1RKItxn8oyyucs96C7wzRz-nN6Qcr3d7C5ogtN18HBpUDAewZxDbcc3jAtrj2aIO0zuU4KLYSMRkyFoLt8ZuczyuBGNtxdl-3opaY1...";
    Identifier = "18f-BmHuzsbxOsUTPybKyaFn_ImQSYxDC";
    NewName    = "CopiedFile.jpeg";
    NewParent  = "root";

    Result = OPI_GoogleDrive.CopyObject(Token, Identifier, NewName, NewParent);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint gdrive CopyObject \
             --token "***" \
             --object "1SdgrlViZM0g-ROR19eyFdWaooX8pZzZQ" \
             --title "CopiedFile.jpeg" \
             --catalog "root"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint gdrive CopyObject ^
             --token "***" ^
             --object "1SdgrlViZM0g-ROR19eyFdWaooX8pZzZQ" ^
             --title "CopiedFile.jpeg" ^
             --catalog "root"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "kind": "drive#file",
 "id": "1spR9Z21272lFG27z6a6eLAwHeKs0ITZo",
 "name": "CopiedFile.jpeg",
 "mimeType": "image/jpeg"
}
```
