---
sidebar_position: 1
description: Generate code retrieval link and other functions to work with Google Sheets 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 Sheets]
---

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

# Generate code retrieval link
 Returns URL for browser authorization



`Function FormCodeRetrievalLink(Val ClientID, Val Calendar = True, Val Drive = True, Val Sheets = True) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | ClientID | --id | String | &#x2714; | Client ID |
  | Calendar | --calendar | Boolean | &#x2716; | Calendar methods permission |
  | Drive | --drive | Boolean | &#x2716; | Drive methods permission |
  | Sheets | --sheets | Boolean | &#x2716; | Sheets methods permission |

  
  Returns:  String - Code retrieval link



```bsl title="1C:Enterprise/OneScript code example"
    ClientID = "345925493105-641q49rl4oflrtr46fkgqf5upiltr4bg.apps.googleusercontent.com";
    Result   = OPI_GoogleSheets.FormCodeRetrievalLink(ClientID);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint gsheets FormCodeRetrievalLink \
             --id "345925493105-641q49rl4oflrtr46fkgqf5upiltr4bg.apps.googleusercontent.com"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint gsheets FormCodeRetrievalLink ^
             --id "345925493105-641q49rl4oflrtr46fkgqf5upiltr4bg.apps.googleusercontent.com"
        ```
    </TabItem>
</Tabs>


```json title="Result"
"https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=345925493105-641q49rl4oflrtr46fkgqf5upiltr4bg.apps.googleusercontent.com&redirect_uri=http://localhost&access_type=offline&scope=https://www.googleapis.com/auth/calendar%20https://www.googleapis.com/auth/drive%20https://www.googleapis.com/auth/spreadsheets"
```
