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: 3

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: 4,331

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...
*GLPI 9.1.6+fusion9.1+1.1+behaviours1.5.0+reports+fields+appliances+pdf+badges+formcreator2.5.2 PHP7.0 Mariadb10
*GLPI 9.2.4(behaviours1.5.2+fusion9.2+1.0+applicatifs2.3.0+dashboard 0.8.9)hebergé sur serveur mutualisé.
*GLPI 9.3.3  en test (ubuntu 18.04 mariadb 10.2.4)

Offline

Board footer

Powered by FluxBB