1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-05-19 22:33:07 +02:00

64 lines
2.1 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 3
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Refresh token
Updates the v2 token using the refresh_token
`Function RefreshToken(Val Parameters = "") Export`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Parameters | --auth | Structure Of String | ✖ | Authorization data. See GetStandardParameters |
2024-10-15 10:16:04 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Twitter
<br/>
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2024-10-15 10:16:04 +03:00
Parameters = GetTwitterAuthData();
Result = OPI_Twitter.RefreshToken(Parameters);
```
2024-10-20 22:36:03 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint twitter RefreshToken \
--auth "{'redirect_uri':'https://api.athenaeum.digital/opi/hs/twitter','client_id':'***','client_secret':'***','access_token':'***','refresh_token':'***','oauth_token':'***','oauth_token_secret':'***','oauth_consumer_key':'***','oauth_consumer_secret':'***'}"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint twitter RefreshToken ^
--auth "{'redirect_uri':'https://api.athenaeum.digital/opi/hs/twitter','client_id':'***','client_secret':'***','access_token':'***','refresh_token':'***','oauth_token':'***','oauth_token_secret':'***','oauth_consumer_key':'***','oauth_consumer_secret':'***'}"
```
</TabItem>
</Tabs>
2024-10-15 10:16:04 +03:00
```json title="Result"
{
"token_type": "bearer",
"expires_in": 7200,
"access_token": "TW1qcjhrVzUyT2tYaVVfZWtvem9wNVFPVlJEcE1xd3ZaU1ZRSkYxOTkzU1hyOjE3Mjg0NTI5NDY2NDM6MToxOmF0OjE",
"scope": "mute.write tweet.moderate.write block.read follows.read offline.access list.write bookmark.read list.read tweet.write space.read block.write like.write like.read users.read tweet.read bookmark.write mute.read follows.write",
"refresh_token": "bnRnOXpVdXVjdlp2azlkVjYzaEMwY2FxdFloTS03aWhYaHFjcEdodVpqMThjOjE3Mjg0NTI5NDY2NDM6MToxOnJ0OjE"
}
```