K
K
Kristina87872020-11-29 20:05:39
Bitrix24
Kristina8787, 2020-11-29 20:05:39

Batch request, how to get the next 50 requests from bitrix24 in php?

I need the list method to give me every 50 next requests, I write like this:

for($i = 0; $i < 10; $i++){
    $arParams['get_elapsed_'.($i+1)] = [
      'method' => 'task.elapseditem.getlist',
      'params' => [
        'order' => ["ID" => "ASC"],
        'filter' => [">=CREATED_DATE" => $dateFrom,"<CREATED_DATE" => $dateTo],
        'select' => ['ID','TASK_ID','COMMENT_TEXT','MINUTES'],
        'more' => true,
        'next' => ($i+1)*50
      ]
    ];
  }


and get error Param #4 (params) for method ctaskelapseditem::getlist() expected to be of type "array", but given something else.; 256/TE/WRONG_ARGUMENTS ,
although this scheme seems to work on ordinary getters, tell me how to take every 50 next results

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Paimurzin, 2020-12-28
@rusellsystems

use the description, there you need to use two parameters to control the size of the list and the current page:

"PARAMS" => array('NAV_PARAMS' => array(    // Постраничка
        "nPageSize" => 2,                        // по 2 элемента на странице
        'iNumPage' => 2                        // страница номер 2
    )),

https://dev.1c-bitrix.ru/rest_help/tasks/task/elap...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question