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-01-07 15:00:22

fernando.vidal
Member
Registered: 2019-01-04
Posts: 5

Create UserID setting Entities

Hello.


I'm creating a user by Rest API and its working.

I'm filling automatically, name, firstname,password, realname... etc all fields are 1 x 1.

Now.. I must to sent the relationship between user and entity, that is 1 x N.


I really appreciate some help or idea how to do this Job.


Thanks.

Offline

#2 2019-01-07 17:12:10

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

Re: Create UserID setting Entities

once you get user_id add profile to thi users valid on entity :


$url=api_url."/User/".$user_id."/profile_user/";
$payload= "{"input": {"users_id":  $user_id,"profiles_id" : $profiles_id,"entities_id": $entities_id,"is_recursive": 0}}";

then, use post method to associate profiles/entities as much as needed


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