Answer the question
In order to leave comments, you need to log in
Crest get list of leads?
Good afternoon! It was necessary to receive a list of leads without authorization according to the conditions, I decided to use https://github.com/bitrix-tools/crest
It turned out something like this
<?
require_once('src/crest.php');
$result = CRest::call(
'crm.lead.list',
[
'filter' => [
'>=DATE_CREATE' => '2020-07-01T00:00:00',
'<=DATE_CREATE' => '2020-08-31T23:59:59',
],
'select' => [
'ID',
'DATE_CREATE',
'TITLE',
'NAME',
'PHONE',
'SOURCE_ID',
'CREATED_BY_ID',
'STATUS_DESCRIPTION',
'COMMENTS'
]
]
);
echo '<PRE>';
print_r ($result);
echo '</PRE>';
Answer the question
In order to leave comments, you need to log in
For the page, try this:
$result = CRest::call(
'crm.lead.list',
[
'filter' => [
...
],
'select' => [
...
],
'start' => 50
]
);
Ideally, it would be generally displayed not in portions, but in given numbers
and even more ideal case to receive immediately csv file
I had a similar problem when I got the company to do everything through a batch request.
In the place of crm.company.list , you substitute what you have more than 50 results and request page by page through batch
$result = CRest::call('batch',
array(
'halt' => 0,
'cmd'=> array(
'list_0' => 'crm.company.list',
'list_1' =>'crm.company.list?start=50',
'list_2' =>'crm.company.list?start=100',
)
)
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question