You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2023-06-15 01:45:51

aziz
Member
Registered: 2021-03-30
Posts: 109

retrieve the complete list in a single GET request

Hi everyone, How can I retrieve all elements at once when making a GET request ? Is there a specific parameter or method I should use to obtain the complete list instead of just the initial 20 elements?
In my case when sending this get request (http://xxx/glpi/apirest.php/search/ticket?1=reset

and the response be :
{
    "totalcount": 46,
    "count": 20,
    "sort": "1",
    "order": "ASC",
    "data": [
        {
            .....   
"content-range": "0-20/46"
}

So I'm getting 20 elements out of 46
Thank you in advance for your assistance.

Last edited by aziz (2023-06-15 01:48:06)

Offline

#2 2023-06-15 08:41:18

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,287

Re: retrieve the complete list in a single GET request

you can set    "range=0-50"  in your request, but you should consider that at some point number of item could exceed range


Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9

Offline

#3 2023-06-15 13:22:47

aziz
Member
Registered: 2021-03-30
Posts: 109

Re: retrieve the complete list in a single GET request

Can you tell me please how to set range =0-50

Offline

#4 2023-06-15 13:24:29

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,287

Re: retrieve the complete list in a single GET request

http://xxx/glpi/apirest.php/search/ticket?1=reset&range=0-50


Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9

Offline

Board footer

Powered by FluxBB