From 11b2b61aac922feb0b129b5889210cd0441f1ff1 Mon Sep 17 00:00:00 2001 From: Jason Secula Date: Wed, 18 Mar 2026 20:20:36 +0100 Subject: [PATCH] Updated SetDocumentToDevice to SetDocumentToItem and added a parameter to set itemType --- GLPIAPI.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GLPIAPI.py b/GLPIAPI.py index b2f05e6..173da38 100644 --- a/GLPIAPI.py +++ b/GLPIAPI.py @@ -160,12 +160,12 @@ class GLPIAPI: files = {file: fileData} return requests.post(self.Server+"/apirest.php/Document/", headers=headers, data=data, files=files) - def SetDocumentToDevice(self, deviceID, documentID): + def SetDocumentToItem(self, itemID, itemType, documentID): body = { "input": { "documents_id": documentID, - "items_id": deviceID, - "itemtype": "Computer" + "items_id": itemID, + "itemtype": itemType } } return requests.post(self.Server+"/apirest.php/Document/"+str(documentID)+"/Document_Item", headers=self.Headers, json=body)