Skip to content

Latest commit

 

History

History
782 lines (708 loc) · 28.1 KB

File metadata and controls

782 lines (708 loc) · 28.1 KB

Get the List of Open Channels imopenlines.config.list.get

{% note tip "" %}

If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.

{% endnote %}

Scope: imopenlines

Who can execute the method: any user

The method imopenlines.config.list.get retrieves a list of open channels.

Method Parameters

{% include Note on required parameters %}

#| || Name type | Description || || PARAMS object | Selection parameters (detailed description) || || OPTIONS object | Additional options (detailed description) || |#

PARAMS Parameter {#params}

#| || Name type | Description || || select array | An array containing the list of fields to be selected.

You can specify fields from the Result Array Element table. The fields QUEUE, QUEUE_USERS_FIELDS, CONFIG_QUEUE are returned only through OPTIONS || || order object | An object for sorting the list of open channels in the format {"field_1": "value_1", ... "field_N": "value_N"}

The sorting direction can take the following values:

  • asc — ascending
  • desc — descending

For field_N, use fields from the Result Array Element table. The fields QUEUE, QUEUE_USERS_FIELDS, CONFIG_QUEUE are not supported in order ||

|| filter object | An object for filtering the list of open channels in the format {"field_1": "value_1", ... "field_N": "value_N"}

For field_N, use fields from the Result Array Element table. The fields QUEUE, QUEUE_USERS_FIELDS, CONFIG_QUEUE are not supported in filter || || limit integer | The number of items per page. Default: 50. Maximum value: 200 || || offset integer | Offset for pagination. Default: 0 || |#

OPTIONS Parameter {#options}

#| || Name type | Description || || QUEUE char | Return the operator queue. Possible values:

  • Y — yes
  • N — no || || CONFIG_QUEUE char | Return the line queue. Each queue element contains ENTITY_TYPE and ENTITY_ID. Possible values:
  • Y — yes
  • N — no || || CHECK_PERMISSION string | Check access to lines by the specified action from the open channels permission map || |#

Code Examples

{% include Note on Examples %}

{% list tabs %}

  • cURL (Webhook)

    curl -X POST \
      -H "Content-Type: application/json" \
      -H "Accept: application/json" \
      -d '{
        "PARAMS": {
          "select": ["ID", "LINE_NAME", "ACTIVE"],
          "order": {"ID": "ASC"},
          "filter": {"ACTIVE": "Y"},
          "limit": 50,
          "offset": 0
        },
        "OPTIONS": {
          "QUEUE": "Y",
          "CONFIG_QUEUE": "Y"
        }
      }' \
      https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/imopenlines.config.list.get
  • cURL (OAuth)

    curl -X POST \
      -H "Content-Type: application/json" \
      -H "Accept: application/json" \
      -d '{
        "PARAMS": {
          "select": ["ID", "LINE_NAME", "ACTIVE"],
          "order": {"ID": "ASC"},
          "filter": {"ACTIVE": "Y"},
          "limit": 50,
          "offset": 0
        },
        "OPTIONS": {
          "QUEUE": "Y",
          "CONFIG_QUEUE": "Y"
        },
        "auth": "**put_access_token_here**"
      }' \
      https://**put_your_bitrix24_address**/rest/imopenlines.config.list.get
  • JS (TS)

    // This snippet is an ES module: top-level await requires type="module" or a bundler.
    // $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
    import { Text } from '@bitrix24/b24jssdk'
    import type { B24Frame } from '@bitrix24/b24jssdk'
    
    declare const $b24: B24Frame
    
    // Shape of each OpenLineItem returned in result[]
    type OpenLineItem = {
      ID: string
      LINE_NAME: string
      ACTIVE: string
      QUEUE?: number[]
      QUEUE_USERS_FIELDS?: Record<string, {
        USER_NAME: string | null
        USER_WORK_POSITION: string | null
        USER_AVATAR: string | null
        USER_AVATAR_ID: number | null
      }>
      CONFIG_QUEUE?: Array<{
        ENTITY_ID: string
        ENTITY_TYPE: string
      }>
    }
    
    try {
      // imopenlines.config.list.get returns a single page (max 50 records). For the whole result set
      // use a list helper: $b24.actions.v2.callList.make() returns every record as one
      // array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
      // NOTE: the list helpers do not accept `order` (it is excluded from their params, so
      // passing it is a TS error) — keep this call.make + `start` variant when sort matters.
      const response = await $b24.actions.v2.call.make<OpenLineItem[]>({
        method: 'imopenlines.config.list.get',
        params: {
          PARAMS: {
            select: ['ID', 'LINE_NAME', 'ACTIVE'],
            order: { ID: 'ASC' },
            filter: { ACTIVE: 'Y' },
            limit: 50,
            offset: 0,
          },
          OPTIONS: {
            QUEUE: 'Y',
            CONFIG_QUEUE: 'Y',
          },
        },
        requestId: Text.getUuidRfc4122()
      })
    
      // The payload is available only on a successful response
      if (!response.isSuccess) {
        console.error(response.getErrorMessages().join('; '))
      } else {
        const result = response.getData()!.result
        console.info('Open lines count:', result.length, 'First line:', result[0]?.LINE_NAME)
      }
    } catch (error) {
      // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
      console.error(error)
    }
  • JS (UMD)

    <!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
    <script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
    <script>
      async function getOpenLineList() {
        try {
          // Initialize the SDK inside a Bitrix24 frame
          const $b24 = await B24Js.initializeB24Frame()
    
          // imopenlines.config.list.get returns a single page (max 50 records). For the whole result set
          // use a list helper: $b24.actions.v2.callList.make() returns every record as one
          // array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
          // NOTE: the list helpers do not accept `order` (it is excluded from their params, so
          // passing it is a TS error) — keep this call.make + `start` variant when sort matters.
          const response = await $b24.actions.v2.call.make({
            method: 'imopenlines.config.list.get',
            params: {
              PARAMS: {
                select: ['ID', 'LINE_NAME', 'ACTIVE'],
                order: { ID: 'ASC' },
                filter: { ACTIVE: 'Y' },
                limit: 50,
                offset: 0,
              },
              OPTIONS: {
                QUEUE: 'Y',
                CONFIG_QUEUE: 'Y',
              },
            },
            requestId: B24Js.Text.getUuidRfc4122()
          })
    
          // The payload is available only on a successful response
          if (!response.isSuccess) {
            console.error(response.getErrorMessages().join('; '))
            return
          }
    
          const result = response.getData().result
          console.info('Open lines count:', result.length, 'First line:', result[0]?.LINE_NAME)
        } catch (error) {
          // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
          console.error(error)
        }
      }
    
      document.addEventListener('DOMContentLoaded', getOpenLineList)
    </script>
  • PHP

    try {
        $response = $b24Service
            ->core
            ->call(
                'imopenlines.config.list.get',
                [
                    'PARAMS' => [
                        'select' => ['ID', 'LINE_NAME', 'ACTIVE'],
                        'order' => ['ID' => 'ASC'],
                        'filter' => ['ACTIVE' => 'Y'],
                        'limit' => 50,
                        'offset' => 0,
                    ],
                    'OPTIONS' => [
                        'QUEUE' => 'Y',
                        'CONFIG_QUEUE' => 'Y',
                    ],
                ]
            );
    
        $result = $response
            ->getResponseData()
            ->getResult();
    
        print_r($result);
    } catch (Throwable $e) {
        echo $e->getMessage();
    }
  • BX24.js

    BX24.callMethod(
        'imopenlines.config.list.get',
        {
            PARAMS: {
                select: ['ID', 'LINE_NAME', 'ACTIVE'],
                order: { ID: 'ASC' },
                filter: { ACTIVE: 'Y' },
                limit: 50,
                offset: 0
            },
            OPTIONS: {
                QUEUE: 'Y',
                CONFIG_QUEUE: 'Y'
            }
        },
        function(result)
        {
            if (result.error())
            {
                console.error(result.error());
            }
            else
            {
                console.log(result.data());
            }
        }
    );
  • PHP CRest

    require_once('crest.php');
    
    $result = CRest::call(
        'imopenlines.config.list.get',
        [
            'PARAMS' => [
                'select' => ['ID', 'LINE_NAME', 'ACTIVE'],
                'order' => ['ID' => 'ASC'],
                'filter' => ['ACTIVE' => 'Y'],
                'limit' => 50,
                'offset' => 0,
            ],
            'OPTIONS' => [
                'QUEUE' => 'Y',
                'CONFIG_QUEUE' => 'Y',
            ],
        ]
    );
    
    print_r($result);
  • Go

    // client and ctx are already created — see the Go SDK section
    res, err := client.Core().Call(ctx, "imopenlines.config.list.get", b24.Params{
    	"PARAMS": b24.Params{
    		"select": []string{"ID", "LINE_NAME", "ACTIVE"},
    		"order": b24.Params{
    			"ID": "ASC",
    		},
    		"filter": b24.Params{
    			"ACTIVE": "Y",
    		},
    		"limit":  50,
    		"offset": 0,
    	},
    	"OPTIONS": b24.Params{
    		"QUEUE":        "Y",
    		"CONFIG_QUEUE": "Y",
    	},
    }, b24.WithIdempotent())
    if err != nil {
    	return fmt.Errorf("imopenlines.config.list.get: %w", err)
    }
    
    var items []struct {
    	ID       b24.ID `json:"ID"`
    	LineName string `json:"LINE_NAME"`
    	Active   string `json:"ACTIVE"`
    }
    if err := json.Unmarshal(res.Result, &items); err != nil {
    	return fmt.Errorf("parse response: %w", err)
    }
    for _, it := range items {
    	fmt.Println(it.ID, it.LineName)
    }

{% endlist %}

Response Handling

HTTP Status: 200

{
    "result": [
        {
            "ID": "15",
            "LINE_NAME": "VIP Support Line",
            "ACTIVE": "Y",
            "QUEUE": [101, 205],
            "QUEUE_USERS_FIELDS": {
                "101": {
                    "USER_NAME": "John Smith",
                    "USER_WORK_POSITION": "Operator",
                    "USER_AVATAR": "https://example.bitrix24.com/upload/main/a1b/avatar.jpg",
                    "USER_AVATAR_ID": 312
                },
                "205": {
                    "USER_NAME": "Anna Johnson",
                    "USER_WORK_POSITION": null,
                    "USER_AVATAR": "",
                    "USER_AVATAR_ID": null
                }
            },
            "CONFIG_QUEUE": [
                {
                    "ENTITY_ID": "10",
                    "ENTITY_TYPE": "department"
                }
            ]
        },
        {
            "ID": "16",
            "LINE_NAME": "Sales Line",
            "ACTIVE": "Y",
            "QUEUE": [101],
            "QUEUE_USERS_FIELDS": {
                "101": {
                    "USER_NAME": "John Smith",
                    "USER_WORK_POSITION": "Operator",
                    "USER_AVATAR": "https://example.bitrix24.com/upload/main/a1b/avatar.jpg",
                    "USER_AVATAR_ID": 312
                }
            },
            "CONFIG_QUEUE": []
        }
    ],
    "time": {
        "start": 1741688574.50636,
        "finish": 1741688574.701981,
        "duration": 0.19562101364135742,
        "processing": 0.09473705291748047,
        "date_start": "2025-03-11T10:29:34+01:00",
        "date_finish": "2025-03-11T10:29:34+01:00",
        "operating_reset_at": 1741689174,
        "operating": 0
    }
}

Returned Data

#| || Name type | Description || || result array | List of open channels (detailed description) || || time time | Information about the request execution time || |#

Result Array Element {#result}

#| || Name type | Description || || ID string | Identifier of the open channel || || LINE_NAME string | Name of the open channel || || ACTIVE string | Activity status of the line. Possible values:

  • Y — line is active
  • N — line is inactive || || CRM string | CRM interaction status. Possible values:
  • Y — yes
  • N — no || || CRM_CREATE string | Scenario for creating a CRM element || || CRM_CREATE_SECOND string | Additional mode for creating a CRM element || || CRM_CREATE_THIRD string | Additional mode for creating a CRM element. Possible values:
  • Y — yes
  • N — no || || CRM_FORWARD string | Status of forwarding to CRM. Possible values:
  • Y — yes
  • N — no || || CRM_CHAT_TRACKER string | Status of sending the dialog to the CRM tracker. Possible values:
  • Y — yes
  • N — no || || CRM_TRANSFER_CHANGE string | Status of changing the responsible person during transfer. Possible values:
  • Y — yes
  • N — no || || CRM_SOURCE string | Mode of working with the source in CRM || || QUEUE_TYPE string | Mode of distributing requests || || QUEUE_TIME string | Time to transfer the request to the next operator || || NO_ANSWER_TIME string | Time until the no-answer scenario is triggered || || CHECK_AVAILABLE string | Check the availability of operators. Possible values:
  • Y — yes
  • N — no || || WATCH_TYPING string | Show text being typed by the operator. Possible values:
  • Y — yes
  • N — no || || WELCOME_BOT_ENABLE string | Status of using the welcome bot. Possible values:
  • Y — yes
  • N — no || || WELCOME_MESSAGE string | Status of the welcome message. Possible values:
  • Y — yes
  • N — no || || WELCOME_MESSAGE_TEXT string | Text of the welcome message || || VOTE_MESSAGE string | Status of the feedback request. Possible values:
  • Y — yes
  • N — no || || VOTE_TIME_LIMIT string | Time limit for feedback || || VOTE_BEFORE_FINISH string | Request feedback before the dialog ends. Possible values:
  • Y — yes
  • N — no || || VOTE_CLOSING_DELAY string | Use a delay for closing after feedback. Possible values:
  • Y — yes
  • N — no || || VOTE_MESSAGE_1_TEXT string | Text of the first feedback scenario || || VOTE_MESSAGE_1_LIKE string | Text for positive feedback in the first scenario || || VOTE_MESSAGE_1_DISLIKE string | Text for negative feedback in the first scenario || || VOTE_MESSAGE_2_TEXT string | Text of the second feedback scenario || || VOTE_MESSAGE_2_LIKE string | Text for positive feedback in the second scenario || || VOTE_MESSAGE_2_DISLIKE string | Text for negative feedback in the second scenario || || AGREEMENT_MESSAGE string | Status of displaying the agreement message. Possible values:
  • Y — yes
  • N — no || || AGREEMENT_ID string | Identifier of the agreement || || CATEGORY_ENABLE string | Status of using categories. Possible values:
  • Y — yes
  • N — no || || CATEGORY_ID string | Identifier of the category || || WELCOME_BOT_JOIN string | Mode of connecting the welcome bot || || WELCOME_BOT_ID string | Identifier of the welcome bot || || WELCOME_BOT_TIME string | Time to wait for the welcome bot connection || || WELCOME_BOT_LEFT string | Mode of disconnecting the welcome bot || || NO_ANSWER_RULE string | Scenario for no response from the operator || || NO_ANSWER_FORM_ID string | Identifier of the no-answer scenario form || || NO_ANSWER_BOT_ID string | Identifier of the no-answer scenario bot || || NO_ANSWER_TEXT string | Text message for no response || || WORKTIME_ENABLE string | Status of considering working hours. Possible values:
  • Y — yes
  • N — no || || WORKTIME_FROM string | Start of working hours || || WORKTIME_TO string | End of working hours || || WORKTIME_TIMEZONE string | Working hours time zone || || WORKTIME_HOLIDAYS array | Array of holidays || || WORKTIME_DAYOFF array | Array of days off || || WORKTIME_DAYOFF_RULE string | Scenario for handling requests during non-working hours || || WORKTIME_DAYOFF_FORM_ID string | Identifier of the non-working hours scenario form || || WORKTIME_DAYOFF_BOT_ID string | Identifier of the non-working hours scenario bot || || WORKTIME_DAYOFF_TEXT string | Text message during non-working hours || || CLOSE_RULE string | Scenario for closing the dialog || || CLOSE_FORM_ID string | Identifier of the closing form || || CLOSE_BOT_ID string | Identifier of the closing bot || || CLOSE_TEXT string | Text message upon closing || || FULL_CLOSE_TIME string | Time for full session closure || || AUTO_CLOSE_RULE string | Auto-closing scenario || || AUTO_CLOSE_FORM_ID string | Identifier of the auto-closing form || || AUTO_CLOSE_BOT_ID string | Identifier of the auto-closing bot || || AUTO_CLOSE_TIME string | Time until auto-closing || || AUTO_CLOSE_TEXT string | Text for auto-closing || || AUTO_EXPIRE_TIME string | Time until activity expiration || || DATE_CREATE object | Date of setting creation in serialized form || || DATE_MODIFY object | Date of setting modification in serialized form || || MODIFY_USER_ID string | Identifier of the user who modified the settings || || TEMPORARY string | Status of temporary line. Possible values:
  • Y — temporary line
  • N — permanent line || || XML_ID string | External identifier. Possible values:
  • string — external identifier is set
  • null — external identifier is not set || || LANGUAGE_ID string | Language of the line || || QUICK_ANSWERS_IBLOCK_ID string | Identifier of the quick answers information block || || SESSION_PRIORITY string | Session priority || || TYPE_MAX_CHAT string | Mode of limiting active dialogs per operator || || MAX_CHAT string | Maximum active dialogs per operator || || OPERATOR_DATA string | Mode of displaying operator data || || QUEUE array | Identifiers of operators in the queue.

Field is returned when OPTIONS.QUEUE = "Y" || || QUEUE_USERS_FIELDS object | Additional fields of queue users. Key — user identifier, value — description of queue fields (detailed description).

Field is returned when OPTIONS.QUEUE = "Y" || || CONFIG_QUEUE array | Ordered list of line queue objects (detailed description).

Field is returned when OPTIONS.CONFIG_QUEUE = "Y" || || DEFAULT_OPERATOR_DATA array | Set of default operator display fields || || KPI_FIRST_ANSWER_TIME string | Standard time for the first response || || KPI_FIRST_ANSWER_ALERT string | Status of notification for overdue first response. Possible values:

  • Y — yes
  • N — no || || KPI_FIRST_ANSWER_LIST array | List of recipients for first response notifications. Possible values:
  • array — list of recipients is set
  • null — list of recipients is not set || || KPI_FIRST_ANSWER_TEXT string | Text of notification for overdue first response || || KPI_FURTHER_ANSWER_TIME string | Standard time for subsequent responses || || KPI_FURTHER_ANSWER_ALERT string | Status of notification for overdue subsequent responses. Possible values:
  • Y — yes
  • N — no || || KPI_FURTHER_ANSWER_LIST array | List of recipients for subsequent response notifications. Possible values:
  • array — list of recipients is set
  • null — list of recipients is not set || || KPI_FURTHER_ANSWER_TEXT string | Text of notification for overdue subsequent responses || || KPI_CHECK_OPERATOR_ACTIVITY string | Status of monitoring operator activity. Possible values:
  • Y — yes
  • N — no || || SEND_NOTIFICATION_EMPTY_QUEUE string | Status of notifications for an empty queue. Possible values:
  • Y — yes
  • N — no || || USE_WELCOME_FORM string | Status of using the welcome form. Possible values:
  • Y — yes
  • N — no || || WELCOME_FORM_ID string | Identifier of the welcome form || || WELCOME_FORM_DELAY string | Status of delay in showing the welcome form. Possible values:
  • Y — yes
  • N — no || || SEND_WELCOME_EACH_SESSION string | Show welcome message in each session. Possible values:
  • Y — yes
  • N — no || || CONFIRM_CLOSE string | Require confirmation for closing. Possible values:
  • Y — yes
  • N — no || || IGNORE_WELCOME_FORM_RESPONSIBLE string | Ignore the responsible person in the welcome form. Possible values:
  • Y — yes
  • N — no || |#

QUEUE_USERS_FIELDS Object {#queue-users-fields-item}

#| || Name type | Description || || USER_NAME string | User's name. Possible values:

  • string — user's name is set
  • null — user's name is not set || || USER_WORK_POSITION string | User's position. Possible values:
  • string — position is set
  • null — position is not set || || USER_AVATAR string | Link to avatar. Possible values:
  • string — link to avatar is set
  • null — avatar is not set || || USER_AVATAR_ID string | Identifier of the avatar file || |#

CONFIG_QUEUE Object {#config-queue-item-fields}

#| || Name type | Description || || ENTITY_ID string | Identifier of the object in the queue || || ENTITY_TYPE string | Type of the object in the queue || |#

Error Handling

HTTP Status: 400

{
    "error": "INVALID_FORMAT",
    "error_description": "A wrong format for the PARAMS field 'filter' is passed"
}

{% include notitle error handling %}

Possible Error Codes

#| || Status | Code | Description | Value || || 400 | INVALID_FORMAT | Unsupported PARAMS fields are passed: ... | PARAMS contains fields that are not in the select, filter, order, limit, offset list || || 400 | INVALID_FORMAT | A wrong format for the PARAMS field 'select' is passed | The PARAMS.select field is not passed as an array || || 400 | INVALID_FORMAT | A wrong format for the PARAMS field 'order' is passed | The PARAMS.order field is passed in an incorrect format || || 400 | INVALID_FORMAT | A wrong format for the PARAMS field 'filter' is passed | The PARAMS.filter field is passed in an incorrect format || || 400 | INVALID_FORMAT | A non-negative integer is expected in the PARAMS field 'limit' | The PARAMS.limit field must be a non-negative integer || || 400 | INVALID_FORMAT | A non-negative integer is expected in the PARAMS field 'offset' | The PARAMS.offset field must be a non-negative integer || || 400 | INVALID_FORMAT | A wrong field name is passed in the PARAMS field 'select' | PARAMS.select contains an empty or invalid field name || || 400 | INVALID_FORMAT | A wrong field name is passed in the PARAMS field 'order' | PARAMS.order contains an empty or invalid field name || || 400 | INVALID_FORMAT | A wrong field name is passed in the PARAMS field 'filter' | PARAMS.filter contains an empty or invalid field name || || 400 | INVALID_FORMAT | An unknown field '...' is passed in the PARAMS field 'select' | PARAMS.select contains an unknown field || || 400 | INVALID_FORMAT | An unknown field '...' is passed in the PARAMS field 'order' | PARAMS.order contains an unknown field || || 400 | INVALID_FORMAT | An unknown field '...' is passed in the PARAMS field 'filter' | PARAMS.filter contains an unknown field || || 400 | INVALID_FORMAT | A wrong field alias is passed in the PARAMS field 'select' | PARAMS.select contains an invalid field alias || || 400 | INVALID_FORMAT | The alias '...' matches an existing field in the PARAMS field 'select' | The alias in PARAMS.select conflicts with an existing field || || 400 | INVALID_FORMAT | A wrong sorting direction is passed in the PARAMS field 'order' | PARAMS.order contains a sorting direction other than ASC or DESC || || 400 | INVALID_FORMAT | Unsupported OPTIONS fields are passed: ... | OPTIONS contains fields that are not in the QUEUE, CONFIG_QUEUE, CHECK_PERMISSION list || || 400 | INVALID_FORMAT | A wrong format for the OPTIONS field 'QUEUE' is passed | The OPTIONS.QUEUE field is not passed as a scalar value || || 400 | INVALID_FORMAT | A wrong format for the OPTIONS field 'CONFIG_QUEUE' is passed | The OPTIONS.CONFIG_QUEUE field is not passed as a scalar value || || 400 | INVALID_FORMAT | An unknown value for the OPTIONS field 'CHECK_PERMISSION' is passed | OPTIONS.CHECK_PERMISSION contains an unknown action || |#

{% include system errors %}

Continue Learning