mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2024-12-21 01:50:24 +02:00
47 lines
1012 B
Markdown
47 lines
1012 B
Markdown
---
|
|
sidebar_position: 2
|
|
---
|
|
|
|
# Get token
|
|
Gets token based on the code from the GetAuthorizationLink page
|
|
|
|
|
|
*Function GetToken(Val AppKey, Val AppSecret, Val Code) Export*
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|-|-|-|-|
|
|
| AppKey | --appkey | String | Application key |
|
|
| AppSecret | --appsecret | String | Application secret |
|
|
| Code | --code | String | Code from the authorization page |
|
|
|
|
|
|
Returns: Key-Value Pair - serialized JSON response from Dropbox
|
|
|
|
```bsl title="Code example"
|
|
|
|
AppKey = "oynqxds...";
|
|
AppSecret = "tk2oewn...";
|
|
Code = "bTCiUTzxe6kAAAAAAAAAGN1NMZIxyqETKr4o7OS2dU8";
|
|
|
|
Result = OPI_Dropbox.GetToken(AppKey, AppSecret, Code);
|
|
|
|
|
|
```
|
|
|
|
```sh title="CLI command example"
|
|
|
|
oint dropbox GetToken --appkey "oynqxds..." --appsecret "tk2oewn..." --code "bTCiUTzxe6kAAAAAAAAAGN1NMZIxyqETKr4o7OS2dU8"
|
|
|
|
|
|
```
|
|
|
|
|
|
```json title="Result"
|
|
|
|
{
|
|
"error": "invalid_grant",
|
|
"error_description": "code doesn't exist or has expired"
|
|
}
|
|
|
|
```
|