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-04-26 23:39:36

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

Assigning a user to a computer

Hi all

I'm struggling to assign a user to a computer, both during creation of the computer and when trying to update it.

I've tried using the fields user and users_id, but neither seem to work.

Here's what I'm sending:

    options.url = "https://server/apirest.php/Computer/" + computer_id;
        options.body = {
            "input": {
                "name": computer.name,
                "users_id": 678
            } };
        options.headers = {
        "Content-Type": "application/json",
        "Session-Token": sessionToken.session_token
    };
    options.json = true;
        putData(options)

I get a  200: True response, and the computer name will update, but the user doesn't get added.

Any help greatly appreciated!

Many thanks

David

Offline

Board footer

Powered by FluxBB