il faut utiliser la propriété "range" (ex: http://path/to/glpi/apirest.php/Computer/?expand_drodpowns=true&range=0-1000).
Le problème que je rencontre (sous powershell) est qu'à partir d'une certaine quantité de données la requête ne remonte plus un tableau (json) mais un texte (string).
dans ce cas je fais une boucle pour récupérer les données avec un range plus petit et incrémenté mon tableau (range=0-100, range=101-200...)
Nous n'arrivons pas à récupérer plus de 200 éléments via l'API ?
Exemple d'utilisation
Requête
curl_setopt_array($curl, array(
CURLOPT_URL => API_GLPI_URL.$url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_HTTPHEADER => array(
APP_TOKEN,
SESSION_TOKEN.self::$session
),
));
Exécution
$tickets = $glpi->getData('search/Computer');
var_dump($tickets);
die();
Retour HTTP
/srv/http/glpi/index.php:24:
array (size=6)
'totalcount' => int 1477
'count' => int 200
'sort' => int 1
'order' => string 'ASC' (length=3)
'data' =>
array (size=200)
...
Est-ce paramétrable ? sinon existe-il un contournement ?
Merci
]]>