[freeside-commits] branch master updated. ff911c91cdc360cdd8282b15e4191a79b96efee8

Ivan ivan at 420.am
Wed Sep 13 14:18:49 PDT 2017


The branch, master has been updated
       via  ff911c91cdc360cdd8282b15e4191a79b96efee8 (commit)
      from  8ca189326db97dfb6265a51e46bc988002dbe625 (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 ff911c91cdc360cdd8282b15e4191a79b96efee8
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Sep 13 14:18:48 2017 -0700

    better documentation for UIA's API needs, RT#76831

diff --git a/FS/FS/API.pm b/FS/FS/API.pm
index f9cc37e..6e09713 100644
--- a/FS/FS/API.pm
+++ b/FS/FS/API.pm
@@ -16,7 +16,20 @@ FS::API - Freeside backend API
 
 =head1 SYNOPSIS
 
-  use FS::API;
+  use Frontier::Client;
+  use Data::Dumper;
+
+  my $url = new URI 'http://localhost:8008/'; #or if accessing remotely, secure
+                                              # the traffic
+
+  my $xmlrpc = new Frontier::Client url=>$url;
+
+  my $result = $xmlrpc->call( 'FS.API.customer_info',
+                                'secret'  => 'sharingiscaring',
+                                'custnum' => 181318,
+                            );
+
+  print Dumper($result);
 
 =head1 DESCRIPTION
 
@@ -525,6 +538,23 @@ sub update_customer {
 Returns general customer information. Takes a list of keys and values as
 parameters with the following keys: custnum, secret 
 
+Example:
+
+  use Frontier::Client;
+  use Data::Dumper;
+
+  my $url = new URI 'http://localhost:8008/'; #or if accessing remotely, secure
+                                              # the traffic
+
+  my $xmlrpc = new Frontier::Client url=>$url;
+
+  my $result = $xmlrpc->call( 'FS.API.customer_info',
+                                'secret'  => 'sharingiscaring',
+                                'custnum' => 181318,
+                            );
+
+  print Dumper($result);
+
 =cut
 
 sub customer_info {
@@ -542,6 +572,28 @@ sub customer_info {
 Returns customer service information.  Takes a list of keys and values as
 parameters with the following keys: custnum, secret
 
+Example:
+
+  use Frontier::Client;
+  use Data::Dumper;
+
+  my $url = new URI 'http://localhost:8008/'; #or if accessing remotely, secure
+                                              # the traffic
+
+  my $xmlrpc = new Frontier::Client url=>$url;
+
+  my $result = $xmlrpc->call( 'FS.API.customer_list_svcs',
+                                'secret'  => 'sharingiscaring',
+                                'custnum' => 181318,
+                            );
+
+  print Dumper($result);
+
+  foreach my $cust_svc ( @{ $result->{'cust_svc'} } ) {
+    #print $cust_svc->{mac_addr}."\n" if exists $cust_svc->{mac_addr};
+    print $cust_svc->{circuit_id}."\n" if exists $cust_svc->{circuit_id};
+  }
+
 =cut
 
 sub customer_list_svcs {

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/API.pm |   54 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list