2024-06-20 09:39:55 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 3
|
|
|
|
---
|
|
|
|
|
|
|
|
# Refresh token
|
|
|
|
Update token by refresh token
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
`Function RefreshToken(Val ClientID, Val ClientSecret, Val Refresh) Export`
|
2024-06-20 09:39:55 +02:00
|
|
|
|
2024-08-13 14:52:26 +02:00
|
|
|
| Parameter | CLI option | Type | Description |
|
|
|
|
|-|-|-|-|
|
|
|
|
| ClientID | --clientid | String | Client ID from app settings |
|
|
|
|
| ClientSecret | --clientsecret | String | Client secret from app settings |
|
|
|
|
| Refresh | --refresh | String | Refresh token |
|
2024-06-20 09:39:55 +02:00
|
|
|
|
2024-08-13 14:52:26 +02:00
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
|
2024-06-20 09:39:55 +02:00
|
|
|
|
2024-07-10 13:05:58 +02:00
|
|
|
<br/>
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-20 09:39:55 +02:00
|
|
|
```bsl title="Code example"
|
2024-08-13 15:37:03 +02:00
|
|
|
ClientID = "local.6667fc928a50a9.70414732";
|
|
|
|
ClientSecret = "ZeKyeYIgy2NsHZqsIHY6GfG1V...";
|
|
|
|
Refresh = "eebed066006e9f06006b12e400000001000...";
|
2024-08-13 14:52:26 +02:00
|
|
|
|
|
|
|
Result = OPI_Bitrix24.RefreshToken(ClientID, ClientSecret, Refresh);
|
2024-06-20 09:39:55 +02:00
|
|
|
```
|
2024-08-13 14:52:26 +02:00
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-06-20 09:39:55 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
2024-08-13 14:52:26 +02:00
|
|
|
|
|
|
|
oint bitrix24 RefreshToken --clientid "local.6667fc928a50a9.70414732" --clientsecret "ZeKyeYIgy2NsHZqsIHY6GfG1V..." --refresh "eebed066006e9f06006b12e400000001000..."
|
2024-06-20 09:39:55 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-07-10 13:11:17 +02:00
|
|
|
{
|
2024-08-13 14:52:26 +02:00
|
|
|
"access_token": "63a46866006e9f06006b12e4000000010000071997e1f54c1043e9f7193734af3018df",
|
|
|
|
"expires": 1718133859,
|
|
|
|
"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": "53239066006e9f06006b12e4000000010000078523b1fc75d58d6f0fa98b4632bc70ce"
|
|
|
|
}
|
2024-06-20 09:39:55 +02:00
|
|
|
```
|