Answer the question
In order to leave comments, you need to log in
Does the Bitrix24 REST API have an OR operator for crm.deal.list filters?
The task arose - it is necessary to search for deals with filtering by two fields. That is, I need to find all the results where the UF_CRM_***1 or UF_CRM_***2 field contains a substring. I send the following array:
$params = [
'order' => [
'STAGE_ID' => 'ASC'
],
'filter' => [
[
'LOGIC' => 'OR',
'UF_CRM_***1' => trim( $_GET['proposal'] ),
'UF_CRM_***2' => trim( $_GET['proposal'] )
]
],
'select' => [ 'COMPANY_ID', 'STAGE_ID', 'UF_CRM_***'1, 'UF_CRM_***'2, 'DATE_MODIFY' ]
];
Answer the question
In order to leave comments, you need to log in
Good afternoon!
In the rest API, this feature is not implemented, in such cases I used the batch method batch .
Since the documentation does not really help to make a request, I'll post the solution here.
$params = [
'cmd' => [
'kp_num' => 'crm.deal.list?' . http_build_query(
[
'filter' => [
'UF_CRM_***' => '111',
],
'select' => [
'ID',
'COMPANY_ID',
'STAGE_ID',
'UF_CRM_***',
'DATE_MODIFY'
]
]
),
'ord_num' => 'crm.deal.list?' . http_build_query(
[
'filter' => [
'UF_CRM_***' => '222',
],
'select' => [
'ID',
'COMPANY_ID',
'STAGE_ID',
'UF_CRM_***,
'DATE_MODIFY'
]
]
),
]
];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question