﻿---
sidebar_position: 3
---

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

# Refresh token
 Update token by refresh token



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

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | ClientID | --clientid | String | &#x2714; | Client ID from app settings |
  | ClientSecret | --clientsecret | String | &#x2714; | Client secret from app settings |
  | Refresh | --refresh | String | &#x2714; | Refresh token |

  
  Returns:  Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API

<br/>




```bsl title="1C:Enterprise/OneScript code example"
    ClientID     = "local.6667fc928a50a9.70414732";
    ClientSecret = "ZeKyeYIgy2NsHZqsIHY6GfG1V...";
    Refresh      = "98657e67006e9f06006b12e400000001000...";

    Result = OPI_Bitrix24.RefreshToken(ClientID, ClientSecret, Refresh);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint bitrix24 RefreshToken \
             --clientid "***" \
             --clientsecret "***" \
             --refresh "***"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint bitrix24 RefreshToken ^
             --clientid "***" ^
             --clientsecret "***" ^
             --refresh "***"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "access_token": "6b2e0667006e9f06006b12e4000000010000072c4914d2a629a27f8e468fd6a8ba64ff",
 "expires": 1728458347,
 "expires_in": 3600,
 "scope": "app",
 "domain": "oauth.bitrix.info",
 "server_endpoint": "https://oauth.bitrix.info/rest/",
 "status": "L",
 "client_endpoint": "https://b24-ar17wx.bitrix24.by/rest/",
 "member_id": "00168f0dd11ff00b4aeb8ce5befaa139",
 "user_id": 1,
 "refresh_token": "5bad2d67006e9f06006b12e40000000100000735b526f7211741a7e65fac266c482aca"
}
```
