[freeside-commits] branch FREESIDE_3_BRANCH updated. 7afee164c56224236a4e98b99125869e17b18132
Ivan
ivan at 420.am
Tue Jul 21 19:16:32 PDT 2015
The branch, FREESIDE_3_BRANCH has been updated
via 7afee164c56224236a4e98b99125869e17b18132 (commit)
from 1bfdf0c3197b3daa99023be73f8b756debc336b8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7afee164c56224236a4e98b99125869e17b18132
Author: Ivan Kohler <ivan at freeside.biz>
Date: Tue Jul 21 19:16:28 2015 -0700
self-service API list_contacts doc, RT#37372
diff --git a/FS/FS/ClientAPI/MyAccount/contact.pm b/FS/FS/ClientAPI/MyAccount/contact.pm
index 5f5bd2d..009658d 100644
--- a/FS/FS/ClientAPI/MyAccount/contact.pm
+++ b/FS/FS/ClientAPI/MyAccount/contact.pm
@@ -79,7 +79,7 @@ sub list_contacts {
#TODO: contact phone numbers
'comment' => $_->comment,
'selfservice_access' => $_->selfservice_access,
- 'disabled' => $_->disabled,
+ #'disabled' => $_->disabled,
};
} $cust_main->cust_contact );
diff --git a/bin/xmlrpc-list_contacts b/bin/xmlrpc-list_contacts
new file mode 100755
index 0000000..ffe2a31
--- /dev/null
+++ b/bin/xmlrpc-list_contacts
@@ -0,0 +1,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;
diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm
index 965d22f..9764ad4 100644
--- a/fs_selfservice/FS-SelfService/SelfService.pm
+++ b/fs_selfservice/FS-SelfService/SelfService.pm
@@ -1351,6 +1351,46 @@ error message, or empty on success.
=item list_contacts
+Takes a hash reference as parameter with a single key, B<session_id>.
+
+Returns a hash reference with two parameters: B<error>, which contains an error
+message, or empty on success, and B<contacts>, a list of contacts.
+
+B<contacts> is an array reference of hash references (i.e. an array of structs,
+ in XML-RPC). Each hash reference (struct) has the following keys:
+
+=over4
+
+=item contactnum
+
+=item class
+
+Contact class name (contact type).
+
+=item first
+
+First name
+
+=item last
+
+Last name
+
+=item title
+
+Position ("Director of Silly Walks"), NOT honorific ("Mr." or "Mrs.")
+
+=item emailaddress
+
+Comma-separated list of email addresses
+
+=item comment
+
+=item selfservice_access
+
+Y when enabled
+
+=back
+
=item edit_contact
Updates information for the currently-logged in contact, or (optionally) the
-----------------------------------------------------------------------
Summary of changes:
FS/FS/ClientAPI/MyAccount/contact.pm | 2 +-
bin/{xmlrpc-edit_contact => xmlrpc-list_contacts} | 11 +++---
fs_selfservice/FS-SelfService/SelfService.pm | 40 +++++++++++++++++++++
3 files changed, 46 insertions(+), 7 deletions(-)
copy bin/{xmlrpc-edit_contact => xmlrpc-list_contacts} (63%)
More information about the freeside-commits
mailing list