Convert code to token
Converts the code to a token after entering the code when executing GetConfirmationCode
- Parameters
- Advanced call ?
Function ConvertCodeToToken(Val ClientId, Val ClientSecret, Val DeviceCode) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| ClientId | --id | String | ✔ | Client id |
| ClientSecret | --secret | String | ✔ | Client secret |
| DeviceCode | --device | String | ✔ | device_code from GetConfirmationCode |
Returns
Map Of KeyAndValue - serialized JSON response from Yandex
| Parameter | Description |
|---|---|
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
ClientID = "cc2ce9d60deb4975be58866d32dbe7aa";
ClientSecret = "7cc0b903d33e41c1...";
DeviceCode = "12345678";
Result = OPI_YandexDisk.ConvertCodeToToken(ClientID, ClientSecret, DeviceCode);
- Bash
- CMD/Bat
oint yadisk ConvertCodeToToken \
--id "cc2ce9d60deb4975be58866d32dbe7aa" \
--secret "***" \
--device "12345678"
oint yadisk ConvertCodeToToken ^
--id "cc2ce9d60deb4975be58866d32dbe7aa" ^
--secret "***" ^
--device "12345678"
Result
{
"error": "invalid_grant",
"error_description": "Code has expired"
}