summaryrefslogtreecommitdiff
path: root/bin/xmlrpc-list_contacts
blob: ffe2a31ad584f749f9b53c2639258b58f25222f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl

use strict;
use Frontier::Client;
use Data::Dumper;

my( $email, $password ) = @ARGV;

my $uri = new URI 'http://localhost:8080/';

my $server = new Frontier::Client ( 'url' => $uri );

my $login_result = $server->call(
  'FS.ClientAPI_XMLRPC.login',
    'email'    => $email,
    'password' => $password,
);
die $login_result->{'error'}."\n" if $login_result->{'error'};

my $list_result = $server->call(
  'FS.ClientAPI_XMLRPC.list_contacts',
    'session_id'   => $login_result->{'session_id'},
);
die $list_result->{'error'}."\n" if $list_result->{'error'};

print Dumper($list_result);

1;