Service(Rest) for manipulate attach files?

Moderator: crythias

Post Reply
AlexSuslov
OTRS newbie
Posts: 4
Joined: 29 Mar 2019, 14:30
OTRS Version?: OTRS 5

Service(Rest) for manipulate attach files?

Post by AlexSuslov » 08 Apr 2019, 10:27

Hi All!
How can I access OTRS 5 attachments?

I need:

- get a list of names files attached to the ticket
- get file by (filename, ticketID)
- attach file to ticket by (ticketID)
- attach file to article by (articleID)

Best regards.
AlexSuslov

root
Moderator
Posts: 1895
Joined: 18 Dec 2007, 12:23
OTRS Version?: 4/5/6
Real Name: Roy Kaldung
Company: Znuny Inc.
Contact:

Re: Service(Rest) for manipulate attach files?

Post by root » 08 Apr 2019, 15:31

Hi,

Check the Perl examples here: https://github.com/OTRS/otrs/tree/rel-6 ... ebservices or search for OTRS and Rest.

One small hint: attachments never belong to a ticket, they always belong to an article.

- Roy
OTRS 5/6 CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Do you need professional services for the ((OTRS)) Community Edition? Check out https://www.znuny.com/

AlexSuslov
OTRS newbie
Posts: 4
Joined: 29 Mar 2019, 14:30
OTRS Version?: OTRS 5

Re: Service(Rest) for manipulate attach files?

Post by AlexSuslov » 11 Apr 2019, 11:57

Hi
Many thanks!

i try to update Ticket with Article (png attached)

https://doc.otrs.com/doc/api/otrs/5.0/P ... et.pm.html

Got no error response:

{"ArticleID":2176001,"TicketNumber":"10051065","TicketID":"622773"}

Article created but there is no file in the ticket or article.

Probably there is still some trick?

Best regards
Alex Suslov

AlexSuslov
OTRS newbie
Posts: 4
Joined: 29 Mar 2019, 14:30
OTRS Version?: OTRS 5

Re: [Solved]Service(Rest) for manipulate attach files?

Post by AlexSuslov » 12 Apr 2019, 05:23

Hi!
Object Ticket and TicketUpdate is different.
Article in Ticket is Array[Article] but Article in TicketUpdate is Article.

https://doc.otrs.com/doc/api/otrs/5.0/P ... et.pm.html
https://doc.otrs.com/doc/api/otrs/5.0/P ... te.pm.html

Post Reply