Get token
Gets a token based on account ID and password
- Parameters
- Advanced call ?
Function GetToken(Val Account, Val Password, TestAPI = False) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Account | --account | String | ✔ | Client identifier (Account) |
| Password | --pass | String | ✔ | Secret key (Password) |
| TestAPI | --testapi | Boolean | ✖ | Flag to use test API for requests |
Returns
Map Of KeyAndValue - serialized JSON response from CDEK
| 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) |
tip
Method at API documentation: Client authorization
1C:Enterprise/OneScript code example
Account = "wqGwiQx0gg8mLtiEKsUinjVSICCjtTEP";
Password = "RmAmgvSgSl...";
Result = OPI_CDEK.GetToken(Account, Password, True);
- Bash
- CMD/Bat
oint cdek GetToken \
--account "wqGwiQx0gg8mLtiEKsUinjVSICCjtTEP" \
--pass "***" \
--testapi "***"
oint cdek GetToken ^
--account "wqGwiQx0gg8mLtiEKsUinjVSICCjtTEP" ^
--pass "***" ^
--testapi "***"
Result
{
"access_token": "***",
"scope": "location:all order:all payment:all",
"token_type": "***",
"expires_in": 3599,
"jti": "36d0e694-d2de-4530-bf0e-3c489fc72830"
}