2024-06-05 10:19:46 +00:00
|
|
|
---
|
|
|
|
sidebar_position: 2
|
|
|
|
---
|
|
|
|
|
|
|
|
# Get token
|
2024-06-23 23:22:01 +03:00
|
|
|
Gets the token by the code received when authorizing using the link from GetAuthorizationLink
|
2024-06-05 10:19:46 +00:00
|
|
|
|
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
`Function GetToken(Val Code, Val Parameters = "") Export`
|
2024-06-05 10:19:46 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
| Parameter | CLI option | Type | Description |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Code | --code | String | Code obtained from authorization See GetAuthorizationLink |
|
2024-10-13 01:21:47 +03:00
|
|
|
| Parameters | --auth | Structure Of String | Authorization data. See GetStandardParameters |
|
2024-06-05 10:19:46 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Twitter
|
2024-06-05 10:19:46 +00:00
|
|
|
|
2024-07-10 14:05:58 +03:00
|
|
|
<br/>
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 10:19:46 +00:00
|
|
|
```bsl title="Code example"
|
2024-09-29 19:41:20 +03:00
|
|
|
Parameters = GetTwitterAuthData();
|
|
|
|
Code = "123456";
|
|
|
|
|
|
|
|
Result = OPI_Twitter.GetToken(Code, Parameters);
|
2024-06-05 10:19:46 +00:00
|
|
|
```
|
2024-10-15 09:53:37 +03:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-06-05 10:19:46 +00:00
|
|
|
|
|
|
|
```json title="Result"
|
2024-09-29 21:40:58 +03:00
|
|
|
{
|
|
|
|
"error": "invalid_request",
|
|
|
|
"error_description": "Value passed for the authorization code was invalid."
|
|
|
|
}
|
2024-06-05 10:19:46 +00:00
|
|
|
```
|