Get token by code
Gets token by code from browser authorization
- Parameters
- Advanced call ?
Function GetTokenByCode(Val ClientID, Val ClientSecret, Val Code) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| ClientID | --id | String | ✔ | Client ID |
| ClientSecret | --secret | String | ✔ | Client secret |
| Code | --code | String | ✔ | Code from browser |
Returns
Map Of KeyAndValue - serialized JSON response from Google
This method has no additional advanced call parameters.
1C:Enterprise/OneScript code example
ClientID = "345925493105-641q49rl4oflrtr46fkgqf5upiltr4bg.apps.googleusercontent.com";
ClientSecret = "GOCSPX-v--MJyEjtV...";
Code = "4/0AeaYSHBDZAbAtChyjMxPKa0DXIilJYYcVCgKYzA_CPmCPSt1mg_KqxI4w5CP3lTlYibpGg";
Result = OPI_GoogleCalendar.GetTokenByCode(ClientID, ClientSecret, Code);
- Bash
- CMD/Bat
oint gcalendar GetTokenByCode \
--id "345925493105-641q49rl4oflrtr46fkgqf5upiltr4bg.apps.googleusercontent.com" \
--secret "***" \
--code "4/0AeaYSHBDZAbAtChyjMxPKa0DXIilJYYcVCgKYzA_CPmCPSt1mg_KqxI4w5CP3lTlYibpGg"
oint gcalendar GetTokenByCode ^
--id "345925493105-641q49rl4oflrtr46fkgqf5upiltr4bg.apps.googleusercontent.com" ^
--secret "***" ^
--code "4/0AeaYSHBDZAbAtChyjMxPKa0DXIilJYYcVCgKYzA_CPmCPSt1mg_KqxI4w5CP3lTlYibpGg"
Result
{
"error": "invalid_grant",
"error_description": "Bad Request"
}