Documentation

user.search

Scope: catalog Permissions to execute: for all

List of Bitrix24 user fields to be retrieved as the result of executed method depends on application/webhook scope. Find more details on access to user data in this article.

This method is used to retrieve list of users with expedited personal data search (name, last name, middle name, name of department, position). Works in two modes: Quick mode, via Fulltext Index and slower mode via right LIKE USER_NAME LIKE "Text%". It is called "right like", when the search is performed only via text search, which starts from a specified phrase, but can contain different endings - such search is considerably faster than with the two-way like "%text%" or left-sided "%text" - due to storage architecture of indexed fields in the Database (support is determined automatically).

Parameters

Parameter Description Available from version
fields Array can contain fields in any combination:
  • NAME - name
  • LAST_NAME - last name
  • WORK_POSITION - position
  • UF_DEPARTMENT_NAME - name of department
  • USER_TYPE - user type. Can have the following values:
    employee - employee,
    extranet - extranet user,
    email - user of email

Or FIND - the field that will search in all listed fields (It is equivalent to the mode of an old CUser::GetList where, the filter NAME_SEARCH can be specified and result received)

This method can operate either with filtration using the key FIND or jointly with all other keys. You cannot use FIND and any other field simultaneously.

This method inherits the behaviour of the user.get method: all parameters from this function are available as well.

Example

Result:

{
  "result": [
    {
      "ID": "2",
      "ACTIVE": true,
      "EMAIL": "m.ivshina@example.com",
      "NAME": "Maria",
      "LAST_NAME": "MacMaster",
      "SECOND_NAME": "",
      "PERSONAL_GENDER": "F",
      "PERSONAL_PROFESSION": "",
      "PERSONAL_WWW": "http://shelenkov.com/horse/events.html",
      "PERSONAL_BIRTHDAY": "1984-04-29T02:00:00+04:00",
      "PERSONAL_PHOTO": "http://www.hazz/upload/main/982/42-17082203.gif",
      "PERSONAL_ICQ": "431-874-61",
      "PERSONAL_PHONE": "",
      "PERSONAL_FAX": "",
      "PERSONAL_MOBILE": "",
      "PERSONAL_PAGER": "",
      "PERSONAL_STREET": "",
      "PERSONAL_CITY": "",
      "PERSONAL_STATE": "",
      "PERSONAL_ZIP": "",
      "PERSONAL_COUNTRY": "0",
      "WORK_COMPANY": "",
      "WORK_POSITION": "IT-\"specialist\"",
      "WORK_PHONE": "+7 495 188 46 29",
      "UF_DEPARTMENT": [
        51,
        55,
        84
      ],
      "UF_INTERESTS": null,
      "UF_SKILLS": null,
      "UF_WEB_SITES": null,
      "UF_XING": null,
      "UF_LINKEDIN": null,
      "UF_FACEBOOK": null,
      "UF_TWITTER": null,
      "UF_SKYPE": null,
      "UF_DISTRICT": null,
      "UF_PHONE_INNER": "4629"
    }
  ],
  "total": 1
}

© «Bitrix24», 2001-2024