Skip to main content

Get lead

Gets a lead by ID

Function GetLead(Val URL, Val LeadID, Val Token = "") Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringURL of webhook or a Bitrix24 domain, when token used
LeadID--leadNumber, StringLead ID
Token--tokenStringAccess token, when app auth method used

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


tip

Method at API documentation: crm.lead.get


1C:Enterprise/OneScript code example
    URL    = "https://b24-ar17wx.bitrix24.by/rest/1/yg2...";
LeadID = "856";

Result = OPI_Bitrix24.GetLead(URL, LeadID);

URL = "b24-ar17wx.bitrix24.by";
Token = "2f4e4067006e9f06006b12e400000001000...";
LeadID = "858";

Result = OPI_Bitrix24.GetLead(URL, LeadID, Token);
    oint bitrix24 GetLead \
--url "b24-ar17wx.bitrix24.by" \
--lead 874 \
--token "***"
Result
{
"result": {
"ID": "394",
"TITLE": "MegaClient",
"HONORIFIC": null,
"NAME": "Ivan",
"SECOND_NAME": null,
"LAST_NAME": "Ivanov",
"COMPANY_TITLE": null,
"COMPANY_ID": null,
"CONTACT_ID": "394",
"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-10-09T09:22:21+03:00",
"DATE_MODIFY": "2024-10-09T09:22:22+03:00",
"DATE_CLOSED": "2024-10-09T09:22:22+03:00",
"STATUS_SEMANTIC_ID": "S",
"OPENED": "N",
"ORIGINATOR_ID": null,
"ORIGIN_ID": null,
"MOVED_BY_ID": "1",
"MOVED_TIME": "2024-10-09T09:22:22+03:00",
"ADDRESS": "Pushkin st., b. 10",
"ADDRESS_2": null,
"ADDRESS_CITY": null,
"ADDRESS_POSTAL_CODE": null,
"ADDRESS_REGION": null,
"ADDRESS_PROVINCE": null,
"ADDRESS_COUNTRY": "Russia",
"ADDRESS_COUNTRY_CODE": null,
"ADDRESS_LOC_ADDR_ID": "790",
"UTM_SOURCE": null,
"UTM_MEDIUM": null,
"UTM_CAMPAIGN": null,
"UTM_CONTENT": null,
"UTM_TERM": null,
"LAST_ACTIVITY_BY": "1",
"LAST_ACTIVITY_TIME": "2024-10-09T09:22:21+03:00",
"EMAIL": [
{
"ID": "2338",
"VALUE_TYPE": "HOME",
"VALUE": "yo@example.com",
"TYPE_ID": "EMAIL"
},
{
"ID": "2340",
"VALUE_TYPE": "WORK",
"VALUE": "hi@example.com",
"TYPE_ID": "EMAIL"
}
],
"PHONE": [
{
"ID": "2342",
"VALUE_TYPE": "WORK",
"VALUE": "88005553535",
"TYPE_ID": "PHONE"
}
]
},
"time": {
"start": 1728454942.34032,
"finish": 1728454942.39366,
"duration": 0.0533421039581299,
"processing": 0.0224511623382568,
"date_start": "2024-10-09T09:22:22+03:00",
"date_finish": "2024-10-09T09:22:22+03:00",
"operating_reset_at": 1728455542,
"operating": 0
}
}