1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-03-11 14:59:26 +02:00

48 lines
1.1 KiB
Markdown
Raw Normal View History

---
sidebar_position: 2
---
# Get token
Gets token based on the code from the GetAuthorizationLink page
2024-07-10 13:58:29 +03:00
`Function GetToken(Val AppKey, Val AppSecret, Val Code) Export`
| Parameter | CLI option | Type | Description |
|-|-|-|-|
| AppKey | --appkey | String | Application key |
| AppSecret | --appsecret | String | Application secret |
| Code | --code | String | Code from the authorization page |
Returns: Map Of KeyAndValue - serialized JSON response from Dropbox
2024-07-10 14:05:58 +03:00
<br/>
2024-07-10 13:58:29 +03:00
```bsl title="Code example"
AppKey = FunctionParameters["Dropbox_Appkey"];
AppSecret = FunctionParameters["Dropbox_Appsecret"];
Code = FunctionParameters["Dropbox_Code"];
Result = OPI_Dropbox.GetToken(AppKey, AppSecret, Code);
```
```sh title="CLI command example"
oint dropbox GetToken --appkey "oynqxds..." --appsecret "tk2oewn..." --code "bTCiUTzxe6kAAAAAAAAAGN1NMZIxyqETKr4o7OS2dU8"
```
```json title="Result"
2024-07-10 14:11:17 +03:00
{
"error": "invalid_grant",
"error_description": "code doesn't exist or has expired"
}
```