1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2024-12-16 11:38:11 +02:00
OpenIntegrations/docs/en/md/Bitrix24/Settings-and-administartion/Refresh-token.md

57 lines
1.5 KiB
Markdown
Raw Normal View History

---
sidebar_position: 3
---
# Refresh token
Update token by refresh token
2024-07-10 12:58:29 +02:00
`Function RefreshToken(Val ClientID, Val ClientSecret, Val Refresh) Export`
| 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 |
Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
2024-07-10 13:05:58 +02:00
<br/>
2024-07-10 12:58:29 +02:00
```bsl title="Code example"
2024-08-13 15:47:32 +02:00
ClientID = "local.6667fc928a50a9.70414732";
ClientSecret = "ZeKyeYIgy2NsHZqsIHY6GfG1V...";
Refresh = "eebed066006e9f06006b12e400000001000...";
Result = OPI_Bitrix24.RefreshToken(ClientID, ClientSecret, Refresh);
```
```sh title="CLI command example"
oint bitrix24 RefreshToken --clientid "local.6667fc928a50a9.70414732" --clientsecret "ZeKyeYIgy2NsHZqsIHY6GfG1V..." --refresh "eebed066006e9f06006b12e400000001000..."
```
```json title="Result"
2024-08-14 08:06:31 +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"
}
```