mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-03-25 21:39:21 +02:00
66 lines
2.0 KiB
Plaintext
66 lines
2.0 KiB
Plaintext
---
|
|
sidebar_position: 2
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Get token
|
|
Gets the token by the code received when authorizing using the link from GetAuthorizationLink
|
|
|
|
|
|
|
|
`Function GetToken(Val Code, Val Parameters = "") Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| Code | --code | String | ✔ | Code obtained from authorization See GetAuthorizationLink |
|
|
| Parameters | --auth | Structure Of String | ✖ | Authorization data. See GetStandardParameters |
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Twitter
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Parameters = GetTwitterAuthData();
|
|
Code = "123456";
|
|
|
|
Result = OPI_Twitter.GetToken(Code, Parameters);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
# JSON data can also be passed as a path to a .json file
|
|
|
|
oint twitter GetToken \
|
|
--code "123456" \
|
|
--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 GetToken ^
|
|
--code "123456" ^
|
|
--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>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"error": "invalid_request",
|
|
"error_description": "Value passed for the authorization code was invalid."
|
|
}
|
|
```
|