Answer the question
In order to leave comments, you need to log in
How to correctly collect a batch request to receive goods from several transactions at once, the number of which is initially unknown?
I am learning to use RestAPI in order to work on web hooks with B24.
It is not possible to correctly collect a batch request in any way.
I have a subquery with deals by a certain status. Next, I want to form a query that will pull out goods from all these transactions. But to understand how I can do it, and whether I can do it at all, I can’t.
Here is what I have:
$listRes = CRest::call(
'batch',
array(
'halt' => 0,
'cmd'=> array(
'deals' => 'crm.deal.list?filter[STAGE_ID]=PREPAYMENT_INVOICE',
'products' => 'crm.deal.productrows.get?id=$result[deals][0][ID]',
)
)
);
echo '<pre>';
print_r($listRes['result']);
echo '</pre>';
Answer the question
In order to leave comments, you need to log in
How to specify in the query that this index should change just dynamically?
'halt' => 0,
'cmd' => [
'deals' => 'crm.deal.list?filter[STAGE_ID]=PREPAYMENT_INVOICE&filter[>ID]=0&limit=10',
'products_0' => 'crm.deal.productrows.get?id=$result[deals][0][ID]',
'products_1' => 'crm.deal.productrows.get?id=$result[deals][1][ID]',
...
'products_8' => 'crm.deal.productrows.get?id=$result[deals][8][ID]',
'products_9' => 'crm.deal.productrows.get?id=$result[deals][9][ID]',
]
'halt' => 0,
'cmd' => [
'deals' => 'crm.deal.list?filter[STAGE_ID]=PREPAYMENT_INVOICE&filter[>ID]=123456&limit=10',
'products_0' => 'crm.deal.productrows.get?id=$result[deals][0][ID]',
'products_1' => 'crm.deal.productrows.get?id=$result[deals][1][ID]',
...
'products_8' => 'crm.deal.productrows.get?id=$result[deals][8][ID]',
'products_9' => 'crm.deal.productrows.get?id=$result[deals][9][ID]',
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question