Получить список лидов
Получает список лидов (50 шт. за запрос максимум) с фильтром или без (см. ПолучитьСтруктуруФильтраЛидов)
Функция ПолучитьСписокЛидов(Знач URL, Знач Фильтр = "", Знач Отступ = 0, Знач Токен = "") Экспорт
Параметр | CLI опция | Тип | Обяз. | Назначение |
---|---|---|---|---|
URL | --url | Строка | ✔ | URL внешнего вебхука или адрес Bitrix24 при использовании токена |
Фильтр | --filter | Структура из КлючИЗначение | ✖ | Структура отбора лидов (см. ПолучитьСтруктуруФильтраЛидов) |
Отступ | --offset | Число, Строка | ✖ | Отступ от начала списка для получения лидов > 50 шт. рекурсивно |
Токен | --token | Строка | ✖ | Токен авторизации, если используется не вебхук |
Возвращаемое значение: Соответствие Из КлючИЗначение - сериализованный JSON ответа от Bitrix24
подсказка
Метод в документации API: crm.lead.list
Пример использования для 1С:Предприятие/OneScript
URL = "https://b24-ar17wx.bitrix24.by/rest/1/yg2...";
Результат = OPI_Bitrix24.ПолучитьСписокЛидов(URL);
URL = "b24-ar17wx.bitrix24.by";
Токен = "2f4e4067006e9f06006b12e400000001000...";
Фильтр = Новый Структура;
Фильтр.Вставить("TITLE" , "Мегаклиент");
Фильтр.Вставить("HAS_EMAIL", "Y");
Результат = OPI_Bitrix24.ПолучитьСписокЛидов(URL, Фильтр, , Токен);
- Bash
- CMD/Bat
oint bitrix24 ПолучитьСписокЛидов \
--url "b24-ar17wx.bitrix24.by" \
--token "***"
oint bitrix24 ПолучитьСписокЛидов ^
--url "b24-ar17wx.bitrix24.by" ^
--token "***"
Результат
{
"result": [
{
"ID": "8",
"TITLE": "Мегаклиент",
"HONORIFIC": null,
"NAME": "Петр",
"SECOND_NAME": null,
"LAST_NAME": "Петров",
"COMPANY_TITLE": null,
"COMPANY_ID": null,
"CONTACT_ID": "8",
"IS_RETURN_CUSTOMER": "N",
"BIRTHDATE": "",
"SOURCE_ID": null,
"SOURCE_DESCRIPTION": null,
"STATUS_ID": "CONVERTED",
"STATUS_DESCRIPTION": null,
"POST": null,
"COMMENTS": null,
"CURRENCY_ID": "BYN",
"OPPORTUNITY": "0.00",
"IS_MANUAL_OPPORTUNITY": "N",
"HAS_PHONE": "Y",
"HAS_EMAIL": "Y",
"HAS_IMOL": "N",
"ASSIGNED_BY_ID": "1",
"CREATED_BY_ID": "1",
"MODIFY_BY_ID": "1",
"DATE_CREATE": "2024-08-22T19:48:12+03:00",
"DATE_MODIFY": "2024-08-22T19:48:12+03:00",
"DATE_CLOSED": "2024-08-22T19:48:12+03:00",
"STATUS_SEMANTIC_ID": "S",
"OPENED": "N",
"ORIGINATOR_ID": null,
"ORIGIN_ID": null,
"MOVED_BY_ID": "1",
"MOVED_TIME": "2024-08-22T19:48:12+03:00",
"ADDRESS": "ул. Пушкина, д. 10",
"ADDRESS_2": null,
"ADDRESS_CITY": null,
"ADDRESS_POSTAL_CODE": null,
"ADDRESS_REGION": null,
"ADDRESS_PROVINCE": null,
"ADDRESS_COUNTRY": "Россия",
"ADDRESS_COUNTRY_CODE": null,
"ADDRESS_LOC_ADDR_ID": "14",
"UTM_SOURCE": null,
"UTM_MEDIUM": null,
"UTM_CAMPAIGN": null,
"UTM_CONTENT": null,
"UTM_TERM": null,
"LAST_ACTIVITY_BY": "1",
"LAST_ACTIVITY_TIME": "2024-08-22T19:48:12+03:00"
},
{
"ID": "10",
"TITLE": "Мегаклиент",
"HONORIFIC": null,
"NAME": "Иван",
"SECOND_NAME": null,
"LAST_NAME": "Иванов",
"COMPANY_TITLE": null,
"COMPANY_ID": null,
"CONTACT_ID": "10",
"IS_RETURN_CUSTOMER": "N",
"BIRTHDATE": "",
"SOURCE_ID": null,
"SOURCE_DESCRIPTION": null,
"STATUS_ID": "CONVERTED",
"STATUS_DESCRIPTION": null,
"POST": null,
"COMMENTS": null,
"CURRENCY_ID": "BYN",
"OPPORTUNITY": "0.00",
"IS_MANUAL_OPPORTUNITY": "N",
"HAS_PHONE": "Y",
"HAS_EMAIL": "Y",
"HAS_IMOL": "N",
"ASSIGNED_BY_ID": "1",
"CREATED_BY_ID": "1",
"MODIFY_BY_ID": "1",
"DATE_CREATE": "2024-08-22T19:48:13+03:00",
"DATE_MODIFY": "2024-08-22T19:48:13+03:00",
"DATE_CLOSED": "2024-08-22T19:48:13+03:00",
"STATUS_SEMANTIC_ID": "S",
"OPENED": "N",
"ORIGINATOR_ID": null,
"ORIGIN_ID": null,
"MOVED_BY_ID": "1",
"MOVED_TIME": "2024-08-22T19:48:13+03:00",
"ADDRESS": "ул. Пушкина, д. 10",
"ADDRESS_2": null,
"ADDRESS_CITY": null,
"ADDRESS_POSTAL_CODE": null,
"ADDRESS_REGION": null,
"ADDRESS_PROVINCE": null,
"ADDRESS_COUNTRY": "Россия",
"ADDRESS_COUNTRY_CODE": null,
"ADDRESS_LOC_ADDR_ID": "18",
"UTM_SOURCE": null,
"UTM_MEDIUM": null,
"UTM_CAMPAIGN": null,
"UTM_CONTENT": null,
"UTM_TERM": null,
"LAST_ACTIVITY_BY": "1",
"LAST_ACTIVITY_TIME": "2024-08-22T19:48:13+03:00"
},
{
"ID": "12",
"TITLE": "Мегаклиент",
"HONORIFIC": null,
"NAME": "Петр",
"SECOND_NAME": null,
"LAST_NAME": "Петров",
"COMPANY_TITLE": null,
"COMPANY_ID": null,
"CONTACT_ID": "12",
"IS_RETURN_CUSTOMER": "N",
"BIRTHDATE": "",
"SOURCE_ID": null,
"SOURCE_DESCRIPTION": null,
"STATUS_ID": "CONVERTED",
"STATUS_DESCRIPTION": null,
"POST": null,
"COMMENTS": null,
"CURRENCY_ID": "BYN",
"OPPORTUNITY": "0.00",
"IS_MANUAL_OPPORTUNITY": "N",
"HAS_PHONE": "Y",
"HAS_EMAIL": "Y",
"HAS_IMOL": "N",
"ASSIGNED_BY_ID": "1",
"CREATED_BY_ID": "1",
"MODIFY_BY_ID": "1",
"DATE_CREATE": "2024-08-22T20:00:19+03:00",
"DATE_MODIFY": "2024-08-22T20:00:20+03:00",
"DATE_CLOSED": "2024-08-22T20:00:20+03:00",
"STATUS_SEMANTIC_ID": "S",
"OPENED": "N",
"ORIGINATOR_ID": null,
"ORIGIN_ID": null,
"MOVED_BY_ID": "1",
"MOVED_TIME": "2024-08-22T20:00:20+03:00",
"ADDRESS": "ул. Пушкина, д. 10",
"ADDRESS_2": null,
"ADDRESS_CITY": null,
"ADDRESS_POSTAL_CODE": null,
"ADDRESS_REGION": null,
"ADDRESS_PROVINCE": null,
...