[freeside-commits] branch FREESIDE_4_BRANCH updated. 98f1a645e6a298a2efcc27ccbd705be1971a0ae3

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


The branch, FREESIDE_4_BRANCH has been updated
       via  98f1a645e6a298a2efcc27ccbd705be1971a0ae3 (commit)
      from  b7581f5418ff86111005b33cb25928b5ac6ec5b5 (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 98f1a645e6a298a2efcc27ccbd705be1971a0ae3
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Sep 13 14:18:49 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