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 2021-11-19 11:11:43

enboig
Member
Registered: 2015-01-28
Posts: 6

API: Link upload file to followup

I have managed to upload a file, and also to create a followup; but I cannot find how to link the file/document to an existing ticket as a follow up. Could somebody post me an example? I read the api documentation, but it is not clear to me how to do it.

Thanks

Offline

#2 2021-11-19 12:45:30

enboig
Member
Registered: 2015-01-28
Posts: 6

Re: API: Link upload file to followup

I tried with:
```
{
    "input": [{
            "document" : 22267,
            "itemtype" : "Ticket",
            "items_id" : 169882,
            "content": "lorem ipsum"

    }]
}
```
but no document is added. And with:
```
{
    "input": [{
            "document" : 22267,
            "itemtype" : "Document",
            "items_id" : 169882,
            "content": "lorem ipsum"

    }]
}
```
I get error 400 "you don't have permissions"; but my api user should be allowed to do so.

Offline

#3 2021-11-19 13:37:34

enboig
Member
Registered: 2015-01-28
Posts: 6

Re: API: Link upload file to followup

I managed to do it. The trick was sending to apirest.php/ITILFollowup a "multipart/form-data" like the one used to upload files; adding

"itemtype":"Ticket",
"items_id": "{$env.ticket_id}",
"content": "text lorem ipsum"

to uploadManifest

Offline

#4 2022-11-28 10:20:27

teguh.umar
Member
From: Indonesia
Registered: 2011-05-20
Posts: 161

Re: API: Link upload file to followup

could you share the postman?


GLPI 10.0.10
Installation mode: zip on OREL9

Offline

Board footer

Powered by FluxBB