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 2021-08-19 19:13:08

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

Get users profiles

hello everyone

Is there an api request to get users list with their profiles (profiles_id,profiles_name)
because using this  url :

https: //aw.with7.glpi-network.cloud/apirest.php/user/

I get the field  “profiles_id": 0 on all users

Appreciate any help smile

Offline

#2 2021-08-19 21:07:55

keepcool5283
Member
Registered: 2013-10-10
Posts: 158

Re: Get users profiles

Hello,

You can try this url to get User_id and Profil_id : server/apirest.php/Profile_user/ and this one to get the match Profile_id/name : server/apirest.php/Profile

Last edited by keepcool5283 (2021-08-19 21:11:28)


Apps Android GLPI Management : https://play.google.com/store/apps/deta … fr.dmn.app
Site Web : http://mdu-tech.fr/
GLPI 9.5.5 sur IIS 10 / PHP 8 / MySQL

Offline

#3 2021-08-20 01:43:17

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

Re: Get users profiles

ty Dumain this really helped me but  do you have an idea on how to create a user and set him to a specific profile using api request.
Thanks in advance.

Last edited by aziz (2021-08-20 16:08:30)

Offline

#4 2021-08-20 09:58:29

keepcool5283
Member
Registered: 2013-10-10
Posts: 158

Re: Get users profiles

With this POST command :

server/apirest.php/User/id_user/Profile_user/?expand_drodpowns=true&session_token=2aglf27j3r9lrrakfnlhXXXXX

And this payload : {"input": {"users_id": 316,"profiles_id":1,"entities_id":1,"is_recursive":0}}


Apps Android GLPI Management : https://play.google.com/store/apps/deta … fr.dmn.app
Site Web : http://mdu-tech.fr/
GLPI 9.5.5 sur IIS 10 / PHP 8 / MySQL

Offline

#5 2021-08-21 01:15:05

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

Re: Get users profiles

appreciate your response but it didn't work for me i get

"ERROR_ITEM_NOT_FOUND",
  "Item not found"

Offline

#6 2021-08-22 17:26:30

keepcool5283
Member
Registered: 2013-10-10
Posts: 158

Re: Get users profiles

Check if your users_id, profiles_id or entities_id are correct

Last edited by keepcool5283 (2021-08-22 19:51:11)


Apps Android GLPI Management : https://play.google.com/store/apps/deta … fr.dmn.app
Site Web : http://mdu-tech.fr/
GLPI 9.5.5 sur IIS 10 / PHP 8 / MySQL

Offline

#7 2023-05-09 16:23:45

djwhite
Member
Registered: 2015-10-25
Posts: 29

Re: Get users profiles

If anyone is stuck on this, the capitalisation is important.
The correct url for setting a profile is:

POST server/apirest.php/User/id_user/Profile_User/

Note the capital U in Profile_User. This had me stumped for a while!

Offline

Board footer

Powered by FluxBB