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 2019-04-30 17:24:18

BlueLegend78
Member
Registered: 2019-04-30
Posts: 3

Beginner: Issue with Getting All Items

Hi,

I am just getting started with the glpi API and run into this issue while querying for "all items" from a collection.

The docs say the url is

URL: apirest.php/:computer/  would return me the entire list of machines. However, I am only getting like 32 machines when its suppose to return 500~

furthermore, when i use "Get an item" to get a single item, and use a script to iterate through 500 ids, I am able to get the information of all 500~ machines

URL: apirest.php/:computer/:id

Any thoughts?

Thanks!

Offline

#2 2019-04-30 17:46:29

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 4,532

Re: Beginner: Issue with Getting All Items

did you set range ?

$url="/Computer/?is_deleted=0&range=0-500&get_hateoas=0";


Trouver la panne avant de réparer...
*GLPI 9.1.6+fusion9.1+1.1+behaviours1.5.0+reports+fields+appliances+pdf+badges+formcreator2.5.2 PHP7.0 Mariadb10
*GLPI 9.4.2(behaviours2.2.1+fusioninventoty 9.4+1.1+applicatifs2.5.0+fields 1.9.1)hebergé sur serveur mutualisé.

Offline

#3 2019-04-30 17:51:28

BlueLegend78
Member
Registered: 2019-04-30
Posts: 3

Re: Beginner: Issue with Getting All Items

LaDenrée wrote:

did you set range ?

$url="/Computer/?is_deleted=0&range=0-500&get_hateoas=0";

Ah, Ic yup that just fixed it.

Thanks for the quick responds!

Offline

#4 2019-05-02 17:29:41

BlueLegend78
Member
Registered: 2019-04-30
Posts: 3

Re: Beginner: Issue with Getting All Items

follow up question, when query /computers the json it returns includes the  "links" entry which has DeviceGraphicCard linked to /Computer/256/DeviceGraphicCard/.
But when i go on that url, it gives back a whole list of graphics cards instead of the one linked to that specific machine.

How would i query the graphics card specific to that machine?

Offline

Board footer

Powered by FluxBB