diff options
Diffstat (limited to 'fs_selfservice/perl/xmlrpc-create_ticket.pl')
-rwxr-xr-x | fs_selfservice/perl/xmlrpc-create_ticket.pl | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/fs_selfservice/perl/xmlrpc-create_ticket.pl b/fs_selfservice/perl/xmlrpc-create_ticket.pl new file mode 100755 index 000000000..cd2037e2c --- /dev/null +++ b/fs_selfservice/perl/xmlrpc-create_ticket.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl + +use strict; +use Frontier::Client; +use Data::Dumper;; + +my $server = new Frontier::Client ( + url => 'http://localhost/selfservice/xmlrpc.cgi', +); + +my $result = $server->call('FS.SelfService.XMLRPC.login', + 'username' => '4155551212', + 'password' => '5454', + 'domain' => 'svc_phone', +); + +#print Dumper($result); +die $result->{'error'} if $result->{'error'}; + +my $session_id = $result->{'session_id'}; +warn "logged in with session_id $session_id\n"; + +my $t_result = $server->call('FS.SelfService.XMLRPC.create_ticket', + 'session_id' => $session_id, + 'requestor' => 'harveylala@example.com', + 'cc' => 'chiquitabanana@example.com', + 'subject' => 'Chiquita keeps sitting on me', + 'message' => "Isn't there something you can do about this?\n\nShe keeps waking me up!", +); + +die $t_result->{'error'} if $t_result->{'error'}; + +warn Dumper($t_result); + +my $ticket_id = $t_result->{'ticket_id'}; +warn "ticket $ticket_id created\n"; + +1; |