---
sidebar_position: 1
description: Get token and other functions to work with CDEK in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, CDEK]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Get token
 Gets a token based on account ID and password



`Function GetToken(Val Account, Val Password, TestAPI = False) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Account | --account | String | &#x2714; | Client identifier (Account) |
  | Password | --pass | String | &#x2714; | Secret key (Password) |
  | TestAPI | --testapi | Boolean | &#x2716; | Flag to use test API for requests |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from CDEK

:::tip
Method at API documentation: [Client authorization](https://api-docs.cdek.ru/33828799.html)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    Account  = "wqGwiQx0gg8mLtiEKsUinjVSICCjtTEP";
    Password = "RmAmgvSgSl...";

    Result = OPI_CDEK.GetToken(Account, Password, True);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint cdek GetToken \
             --account "wqGwiQx0gg8mLtiEKsUinjVSICCjtTEP" \
             --pass "***" \
             --testapi "***"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint cdek GetToken ^
             --account "wqGwiQx0gg8mLtiEKsUinjVSICCjtTEP" ^
             --pass "***" ^
             --testapi "***"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "access_token": "***",
 "token_type": "***",
 "expires_in": 3599,
 "scope": "location:all order:all payment:all",
 "jti": "svTmVdVQA82BuX6Ht2RJ30AtmBU"
}
```
