---
sidebar_position: 6
description: Get lead structure and other functions to work with Bitrix24 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, Bitrix24]
---

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

# Get lead structure
 Gets a structure with field descriptions for creating a lead



`Function GetLeadStructure(Val URL, Val Token = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | URL | --url | String | &#x2714; | URL of webhook or a Bitrix24 domain, when token used |
  | Token | --token | String | &#x2716; | Access token, when app auth method used |

  
  Returns:  Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API

:::tip
Method at API documentation: [crm.lead.fields](https://dev.1c-bitrix.ru/rest_help/crm/leads/crm_lead_fields.php)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    URL = "https://b24-ar17wx.bitrix24.by/rest/1/h0m...";

    Result = OPI_Bitrix24.GetLeadStructure(URL);

    URL   = "b24-ar17wx.bitrix24.by";
    Token = "6ad03969006e9f06006b12e400000001000...";

    Result = OPI_Bitrix24.GetLeadStructure(URL, Token);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint bitrix24 GetLeadStructure \
             --url "b24-ar17wx.bitrix24.by" \
             --token "***"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint bitrix24 GetLeadStructure ^
             --url "b24-ar17wx.bitrix24.by" ^
             --token "***"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "result": {
  "ID": {
   "type": "integer",
   "isRequired": false,
   "isReadOnly": true,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "ID"
  },
  "TITLE": {
   "type": "string",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "Название лида"
  },
  "HONORIFIC": {
   "type": "crm_status",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "statusType": "HONORIFIC",
   "title": "Обращение"
  },
  "NAME": {
   "type": "string",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "Имя"
  },
  "SECOND_NAME": {
   "type": "string",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "Отчество"
  },
  "LAST_NAME": {
   "type": "string",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "Фамилия"
  },
  "BIRTHDATE": {
   "type": "date",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "Дата рождения"
  },
  "COMPANY_TITLE": {
   "type": "string",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "Название компании"
  },
  "SOURCE_ID": {
   "type": "crm_status",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "statusType": "SOURCE",
   "title": "Источник"
  },
  "SOURCE_DESCRIPTION": {
   "type": "string",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "Дополнительно об источнике"
  },
  "STATUS_ID": {
   "type": "crm_status",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "statusType": "STATUS",
   "title": "Стадия"
  },
  "STATUS_DESCRIPTION": {
   "type": "string",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "Дополнительно о стадии"
  },
  "STATUS_SEMANTIC_ID": {
   "type": "string",
   "isRequired": false,
   "isReadOnly": true,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "Состояние статуса"
  },
  "POST": {
   "type": "string",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "Должность"
  },
  "ADDRESS": {
   "type": "string",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "Адрес"
  },
  "ADDRESS_2": {
   "type": "string",
   "isRequired": false,
   "isReadOnly": false,
   "isImmutable": false,
   "isMultiple": false,
   "isDynamic": false,
   "title": "Адрес (стр. 2)"
  },
  "ADDRESS_CITY": {
...
```
