Get token
Gets token based on the code from the GetAuthorizationLink page
- Parameters
- Advanced call ?
Function GetToken(Val AppKey, Val AppSecret, Val Code) Export
| Parameter | CLI option | Type | Required | 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
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
AppKey = "oynqxds...";
AppSecret = "tk2oewn...";
Code = "bTCiUTzxe6kAAAAAAAAAGN1NMZIxyqETKr4o7OS2dU8";
Result = OPI_Dropbox.GetToken(AppKey, AppSecret, Code);
- Bash
- CMD/Bat
oint dropbox GetToken \
--appkey "***" \
--appsecret "***" \
--code "bTCiUTzxe6kAAAAAAAAAGN1NMZIxyqETKr4o7OS2dU8"
oint dropbox GetToken ^
--appkey "***" ^
--appsecret "***" ^
--code "bTCiUTzxe6kAAAAAAAAAGN1NMZIxyqETKr4o7OS2dU8"
Result
{
"error": "invalid_grant",
"error_description": "code doesn't exist or has expired"
}