1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-06-02 23:27:50 +02:00

65 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-09 09:42:00 +03:00
sidebar_position: 1
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-09 09:42:00 +03:00
# Get token
Gets a token based on account ID and password
`Function GetToken(Val Account, Val Password, TestAPI = False) Export`
2024-10-15 15:15:47 +03:00
| 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 |
2024-10-09 09:42:00 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from CDEK
<br/>
:::tip
2024-10-19 17:25:25 +03:00
Method at API documentation: [Client authorization](https://api-docs.cdek.ru/33828799.html)
2024-10-09 09:42:00 +03:00
:::
<br/>
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2024-10-09 09:42:00 +03:00
Account = "wqGwiQx0gg8mLtiEKsUinjVSICCjtTEP";
Password = "RmAmgvSgSl...";
Result = OPI_CDEK.GetToken(Account, Password, True);
```
2024-10-15 09:53:37 +03:00
2024-10-09 09:42:00 +03:00
2024-10-20 22:36:03 +03:00
<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>
2024-10-09 09:42:00 +03:00
```json title="Result"
2024-10-20 22:36:03 +03:00
2024-10-09 09:42:00 +03:00
```