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 2020-01-15 19:01:18

wtralui
Member
Registered: 2019-12-07
Posts: 25

Assign document to a ticket via APIREST

What would be the idea to assign a document to a ticket?

curl -X GET \
-H 'Content-Type: application/json' \
-H "Session-Token: xxxxxx" \
-H "App-Token: xxxxxx" \
-d {"input": { "documents_id":"9101","itemtype":"Ticket","items_id":'2019059732'}} \
'http://xxxxxxx/apirest.php/Document/9102/Document_Item/'

Even that way I can not get anything ..

Offline

#2 2020-01-15 21:33:49

mecmav
Member
From: Brasil
Registered: 2019-03-22
Posts: 330

Re: Assign document to a ticket via APIREST

try this

URL: yourglpi/apirest.php/Document/1/Document_Item/

//doesn't matter the number after "Document/", works with any number, but I don't know why

App-Token: your app-token
Session-Token: sess_token
Content-Type: application/json

{
   
"input":{
       
    "documents_id": "", //here the id of the document already in glpi
       
    "items_id": "311", //here the number of the ticket
       
    "itemtype": "Ticket",
       
    "entities_id": "0",
       
    "users_id": "2" //id of the user who assigning the document to a ticket
   
    }

}

I can see in your input, the field items_id not a valid ticket number, or you use plugin behavior that changes the format of ticket numbering?

Offline

Board footer

Powered by FluxBB