
I've implemented a SOAP interface over OTRS 2.1 that lets a SOAP client create a ticket by passing: email, customerid, subject, body and optionally the name of the queue to drop it in to a SOAP server. I know it's not much but it is quite easy to extend once you grasp the basics of perl and otrs. INSTALLATION: Since it requires SOAP::Lite
perl -MCPAN -e ' install SOAP::Lite '
then drop the attached file in the cgi-bin directory of your webserver. Test it with the following client: #!perl -w use SOAP::Lite; print SOAP::Lite -> uri('http://localhost/OTRS_SOAP') -> proxy('http://localhost/cgi-bin/otrs-rpc.cgi') -> newTicket("me\@somewhere.it", "VIPCUSTOMER", "It Works", "Get me an iPhone") -> result; Enjoy, Umberto

Hi All, Umberto Nicoletti wrote:
I've implemented a SOAP interface over OTRS 2.1
I have been playing with this implementation, and am struggling with the following : I want to create a ticket, and email it to a customer. To this end I have tried to use ArticleSend(). The article is created in the ticket, but it is never emailed to the customer. I have added the following to the otrs-rpc.cgi that Umberto attached in his email : #!/usr/bin/perl -w # # Created by Umberto Nicoletti, 2007 # umberto.nicoletti@gmail.com # ... if ( $TicketID ) { my $ArticleID = $TicketObject->ArticleCreate( TicketID => $TicketID, ArticleType => 'email-internal', SenderType => 'agent', From => $from, Subject => $subject, Body => $body, ContentType => 'text/plain; charset=ISO-8859-15', HistoryType => 'EmailCustomer', HistoryComment => 'Created with RPC server', UserID => $UserID, NoAgentNotify => 0, ); } else { return "Error creating ticket\n"; } *** MY ADDITION START *** my $ArticleID = $TicketObject->ArticleSend( TicketID => $TicketID, ArticleType => 'email-external', SenderType => 'system', From => 'system@myotrs.com', To => 'customer_email@gmail.com', Subject => 'Testing 123', Body => 'Testing by Patrick', Charset => 'ISO-8859-15', Type => 'text/plain', Sign => { Type => 'PGP', SubType => 'Inline|Detached', Key => '81877F5E', Type => 'SMIME', Key => '3b630c80', }, Crypt => { Type => 'PGP', SubType => 'Inline|Detached', Key => '81877F5E', Type => 'SMIME', Key => '3b630c80', }, HistoryType => 'EmailCustomer', HistoryComment => 'Emailing the ticket to the customer', NoAgentNotify => 0, UserID => $UserID, ); *** MY ADDITION END *** return "Created ticket: $TicketID\n"; } Can anybody point out where I am going wrong please? Many thanks! Patrick -- Q: I want to be a sysadmin. What should I do? A: Seek professional help. ---------------------------------------------------------------------- Get a free email account with anti spam protection. http://www.bluebottle.com/tag/2

Patric wrote:
Hi All,
Umberto Nicoletti wrote:
I've implemented a SOAP interface over OTRS 2.1
I have been playing with this implementation, and am struggling with the following :
I want to create a ticket, and email it to a customer. To this end I have tried to use ArticleSend(). The article is created in the ticket, but it is never emailed to the customer.
*** MY ADDITION START ***
my $ArticleID = $TicketObject->ArticleSend( TicketID => $TicketID, ArticleType => 'email-external', SenderType => 'system', From => 'system@myotrs.com', To => 'customer_email@gmail.com', Subject => 'Testing 123', Body => 'Testing by Patrick', Charset => 'ISO-8859-15', Type => 'text/plain', Sign => { Type => 'PGP', SubType => 'Inline|Detached', Key => '81877F5E',
Type => 'SMIME', Key => '3b630c80', }, Crypt => { Type => 'PGP', SubType => 'Inline|Detached', Key => '81877F5E',
Type => 'SMIME', Key => '3b630c80', }, HistoryType => 'EmailCustomer', HistoryComment => 'Emailing the ticket to the customer', NoAgentNotify => 0, UserID => $UserID, );
*** MY ADDITION END ***
Hi All, Just as a follow-up, I solved my problem. If you look at my code above, in the Sign and Crypt fields, I have the Type and Key fields twice in each - in each instance PGP and SMIME are the 2 possible values that you can set, and it is given like that in the example on the API documentation. Not knowing much about this whole lot, I just copied and pasted the examples as is, and the duplicate definitions were causing an error that I found by debugging the code... So look out for those instances when using the API example code! It will save you a LOT of time :] Thanks Patrick -- Q: I want to be a sysadmin. What should I do? A: Seek professional help. ---------------------------------------------------------------------- Find out how you can get spam free email. http://www.bluebottle.com/tag/3
participants (2)
-
Patric
-
Umberto Nicoletti