Views: 2517
Last Modified: 23.03.2022

Gets information about chat participants (supports pagination)

Revision Get current information about current API revision (platform version) – im.revision.get : 30

Parameters

Parameter Example Required Description Revision
DIALOG_ID chat74 Yes Dialog ID. Format:
  • chatXXX – recipient chat in case of chat message
  • or
  • XXX – recipient ID, in case of private conversation message
30
SKIP_EXTERNAL N No Skip all system users - 'Y'|'N' (default 'N') 30
SKIP_EXTERNAL_EXCEPT_TYPES 'bot, email' No String with system user types to be shown in selection 30

Called method and response

JavaScript

B24.callMethod(
  'im.dialog.users.list',
  {
    DIALOG_ID: 'chat74',
    SKIP_EXTERNAL: 'Y'
  },
  res => {
    if (res.error())
    {
      console.error(result.error().ex);
    }
    else
    {
      console.log(res.data())
    }
  }
)

Response example

[
  {
    "id": 1019,
    "active": true,
    "name": "alexa shasha",
    "first_name": "alexa",
    "last_name": "shasha",
    "work_position": "",
    "color": "#df532d",
    "avatar": "",
    "gender": "M",
    "birthday": "",
    "extranet": false,
    "network": false,
    "bot": false,
    "connector": false,
    "external_auth_id": "default",
    "status": "online",
    "idle": false,
    "last_activity_date": "2021-10-30T11:24:12+02:00",
    "mobile_last_date": "2021-10-20T13:02:33+02:00",
    "absent": false,
    "departments": [
      1
    ],
    "phones": false
  },
  {
    "id": 1,
    "active": true,
    "name": "John Smith",
    "first_name": "John",
    "last_name": "Smith",
    "work_position": "",
    "color": "#df532d",
    "avatar": "",
    "gender": "M",
    "birthday": "",
    "extranet": false,
    "network": false,
    "bot": false,
    "connector": false,
    "external_auth_id": "default",
    "status": "online",
    "idle": false,
    "last_activity_date": "2021-10-30T13:36:34+02:00",
    "mobile_last_date": "2021-10-27T16:39:26+02:00",
    "absent": false,
    "departments": [
      1
    ],
    "phones": false
  }
]

Key description:

  • id – user ID
  • active – active user status (not dismissed)
  • name – user first and last name
  • first_name – user name
  • last_name – user last name
  • work_position – position
  • color – user color in hex format
  • avatar – avatar link (empty indicates that avatar is not specified)
  • gender – user gender
  • birthday – user birthday in DD-MM format, if empty – not specified
  • extranet – extranet user attribute (true/false)
  • network – Bitrix24.Network user attribute (true/false)
  • bot – bot attribute (true/false)
  • connector – Open Channels user attribute (true/false)
  • external_auth_id – external authorization code
  • status – selected user status
  • idle – idle date when user is not using his/her PC, in ATOM format (if not specified, false)
  • last_activity_date – date of the last user action, in ATOM format
  • mobile_last_date – date of the last action inside mobile app, in ATOM format (if not specified, false)
  • departments – department IDs
  • absent – date, to which the user has a leave of absence, in ATOM format (if not specified, false)
  • phones – array with phone numbers:
    • work_phone – work phone
    • personal_mobile – mobile phone
    • personal_phone – personal phone

Examples of response on errors

{
  "error":"DIALOG_ID_EMPTY",
  "error_description":"Dialog ID can\u0027t be empty"
}

Key description:

  • error – error code
  • error_description – error brief description

Possible error codes

Code Description
DIALOG_ID_EMPTY Parameter DIALOG_ID is not specified or doesn't match the format
ACCESS_ERROR Current user doesn't have access to data




Courses developed by Bitrix24