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)