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
1C:Enterprise/OneScript code example
Parameters = GetTwitterAuthData();
Code = "123456";
Result = OPI_Twitter.GetToken(Code, Parameters);
- Bash
- CMD/Bat
# 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':'***'}"
:: 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':'***'}"
Result
{
"error": "invalid_request",
"error_description": "Value passed for the authorization code was invalid."
}