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-11-05 23:02:10

elias
Member
Registered: 2019-11-05
Posts: 4

Get user_id by Name

I made a search by name but dont show the user_id in JSON return

URL that I used to search user:

...SERVER/search/user?session_token=SESSION&app_token=TOKEN&criteria[0][itemtype]=user&criteria[0][field]=1&criteria[0][searchtype]=contains&criteria[0][value]=^NAMEUSER$

JSON returned:
{
    "totalcount": 1,
    "count": 1,
    "sort": 1,
    "order": "ASC",
    "data": [{
            "1": "NAMEUSER",
            "80": "Estrutura > Test",
            "34": "Nome do Usuario",
            "5": "email@teste.com.br",
            "6": "",
            "20": "Usuário Padrão",
            "8": 1,
            "13": null,
            "77": "Teste"
        }
    ],
    "content-range": "0-0/1"
}

Offline

#2 2019-11-05 23:55:42

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

Re: Get user_id by Name

use 

&forcedisplay[0]=2

in url


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.4(behaviours2.2.1+fusioninventoty 9.4+1.1+applicatifs2.5.0+fields 1.9.1)hebergé sur serveur mutualisé.

Offline

#3 2019-11-06 15:54:54

elias
Member
Registered: 2019-11-05
Posts: 4

Re: Get user_id by Name

It worked. Thank you very much

Offline

Board footer

Powered by FluxBB