---
sidebar_position: 3
description: Create invitation link and other functions to work with Telegram 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, Telegram]
---

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

# Create invitation link
 Creates a link for joining a closed chat



`Function CreateInvitationLink(Val Token, Val ChatID, Val Title = "", Val ExpirationDate = "", Val UserLimit = 0) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Bot token |
  | ChatID | --chat | String, Number | &#x2714; | Target chat ID or ChatID*TopicID |
  | Title | --title | String | &#x2716; | Invitation title |
  | ExpirationDate | --expire | Date | &#x2716; | Link expiration date (permanent if not specified) |
  | UserLimit | --limit | Number | &#x2716; | User limit (infinite if not specified) |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Telegram

:::tip
Method at API documentation: [createChatInviteLink](https://core.telegram.org/bots/api#createchatinvitelink)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    Token       = "6129457865:AAFyzNYOAFbu...";
    ChannelID   = "@testsichee";
    Day         = 86400;
    CurrentDate = OPI_Tools.GetCurrentDate();

    Title          = "Link " + String(CurrentDate);
    Expiration     = CurrentDate + Day;
    UnixExpiration = OPI_Tools.UNIXTime(Expiration);

    Result = OPI_Telegram.CreateInvitationLink(Token, ChannelID, Title, Expiration, 200);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint telegram CreateInvitationLink \
             --token "***" \
             --chat "***" \
             --title "Link 12/10/2025 18:16:23" \
             --expire "2025-12-11T18:16:23.6963467" \
             --limit 200
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint telegram CreateInvitationLink ^
             --token "***" ^
             --chat "***" ^
             --title "Link 12/10/2025 18:16:23" ^
             --expire "2025-12-11T18:16:23.6963467" ^
             --limit 200
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "ok": true,
 "result": {
  "invite_link": "***",
  "name": "Link 12/10/2025 18:16:23",
  "creator": {
   "id": 6129457865,
   "is_bot": true,
   "first_name": "Бот Виталий",
   "username": "sicheebot"
  },
  "expire_date": 1765473384,
  "member_limit": 200,
  "creates_join_request": false,
  "is_primary": false,
  "is_revoked": false
 }
}
```
