You are not logged in.
Pages: 1
Hi,
I cannot understand how to download attachments of a 'ticket' item, using REST API.
I can see upload samples but no download sample.
I'm using POSTMAN tool to make REST API calls.
When trying to get an attachment, I get following 401 error: "Vous n'avez pas les droits requis pour réaliser cette action."
My queries :
- GET 1 ticket: GET https://xxx/apirest.php/ticket/2116 => works well
- SEARCH docs: GET https://xxx/apirest.php/search/document => error 401
- GET 1 attachment: GET https://xxx/apirest.php/document?id=13&alt=media => error 401
May anyone help me?
Are my queries valid?
What are necessary rights to perform such operation?
Regards,
Guillaume
Offline
Try this
https://xxx/apirest.php/search/document/id
You are using a invalid URL to return data from API
Offline
Hi mecmav, thanks for your help.
My issue regarding 401 error was a configuration error.
Using web site, I was able to see attachments of a ticket inside ticket itself.
But I was not able to see the 'Document' sub menu entry inside Managment menu.
Administrator provided me enough rights to see this menu and sub-menu.
Once done, the query below gives me the attached documents of a ticket:
https://xxx/apirest.php/ticket/2116?with_documents=true
Last edited by GGA (2019-11-14 00:02:00)
Offline
If that can help anyone here below are necessary queries to manage tickets and associated documents:
Get an item by id (2116) and all attachments information:
This allow you to retreive document ids associated to a ticket (here below 1023)
https://xxx/apirest.php/ticket/2116?with_documents=true
Search a document by id:
https://xxx/apirest.php/search/document?criteria[0][field]=2&criteria[0][searchtype]=equal&criteria[0][value]=1023
Get a document by id:
https://xxx/apirest.php/document/1023
Download a document by id:
https://xxx/apirest.php/document/1023?alt=media
Offline
That last one "https://xxx/apirest.php/document/1023?alt=media" didn't work for me.
The request actually works, but the downloaded file is 0B...
Can anyone help me?
Thanks in advance!
Offline
Pages: 1