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-08-24 16:16:15

pedrodaltoe
Member
Registered: 2023-08-24
Posts: 1

Select for Rest

Hello,

I have this Select that I would like to turn into Rest, could someone help me?

SELECT * FROM `glpi_tickets` WHERE entities_id = 9 AND itilcategories_id = 189 AND status = 2;

From what I've researched, it would be something along those lines below, only it's not working.

/search/Ticket/?entities_id=9&criteria[0][itilcategories_id]=189&criteria[0][status]=2

Offline

#2 2023-08-25 09:45:09

lecortex
Member
Registered: 2021-01-14
Posts: 237

Re: Select for Rest

hello,

Pour trouver le bon filtre, aller sur la page "ticket.php" , appliquer vos filtre en direct et ensuite dans l'url vous retrouver les filtre a appliquer pour l'api

exemple avec le filtre "entité" et "statut" du ticket sur new :

url :

http://Url_de_glpi/ticket.php?is_deleted=0&as_map=0&browse=0&criteria[0][link]=AND&criteria[0][field]=80&criteria[0][searchtype]=equals&criteria[0][value]=0&criteria[1][link]=AND&criteria[1][field]=12&criteria[1][searchtype]=equals&criteria[1][value]=1&itemtype=Ticket&start=0&_glpi_csrf_token=........

filtre API :

/search/Ticket?&criteria[0][link]=AND&criteria[0][field]=80&criteria[0][searchtype]=equals&criteria[0][value]=0&criteria[1][link]=AND&criteria[1][field]=12&criteria[1][searchtype]=equals&criteria[1][value]=1&itemtype=Ticket&start=0

edit :   (is_deleted=0   is important)

/search/Ticket?is_deleted=0&criteria[0][link]=AND&criteria[0][field]=80&criteria[0][searchtype]=equals&criteria[0][value]=0&criteria[1][link]=AND&criteria[1][field]=12&criteria[1][searchtype]=equals&criteria[1][value]=1

Last edited by LaDenrée (2023-08-28 12:02:47)


-- Any exchange not written in French comes from an automatic translation. --

Offline

#3 2023-08-30 10:26:24

lecortex
Member
Registered: 2021-01-14
Posts: 237

Re: Select for Rest

Bonjour,

Merci Ladenrée, le "is_deleted=0" apporte quoi à la requête ?


-- Any exchange not written in French comes from an automatic translation. --

Offline

#4 2023-08-30 13:50:54

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

Re: Select for Rest

on n'a pas les tickets de la corbeille dans la réponse


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