---
sidebar_position: 3
description: Refresh token 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';

# Refresh token
 Updates token by Refresh token



`Function RefreshToken(Val ClientID, Val ClientSecret, Val RefreshToken) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | ClientID | --id | String | &#x2714; | Client ID |
  | ClientSecret | --secret | String | &#x2714; | Client secret |
  | RefreshToken | --refresh | String | &#x2714; | Refresh token |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Google



```bsl title="1C:Enterprise/OneScript code example"
    ClientID     = "345925493105-641q49rl4oflrtr46fkgqf5upiltr4bg.apps.googleusercontent.com";
    ClientSecret = "GOCSPX-v--MJyEjtV...";
    RefreshToken = "1//09J8_kLVO7HENCgYIARAAGAkSNwF-L9IrtySthNY3OrNP5Qu...";

    Result = OPI_GoogleDrive.RefreshToken(ClientID, ClientSecret, RefreshToken);
```
 

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


```json title="Result"
{
 "access_token": "***",
 "expires_in": 3599,
 "scope": "https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/spreadsheets",
 "token_type": "***"
}
```
