[freeside-commits] branch master updated. 543ea7d6be3bdf58b30eee5e1363eff737bc58cb

Christopher Burger burgerc at 420.am
Mon Aug 21 09:41:04 PDT 2017


The branch, master has been updated
       via  543ea7d6be3bdf58b30eee5e1363eff737bc58cb (commit)
      from  05de6d688077b77b7da5bc8ae238871f354459a9 (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 543ea7d6be3bdf58b30eee5e1363eff737bc58cb
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Mon Aug 21 12:40:42 2017 -0400

    RT# 27969 - added documentation for advertising_sources api functions

diff --git a/FS/FS/API.pm b/FS/FS/API.pm
index 735088f..f9cc37e 100644
--- a/FS/FS/API.pm
+++ b/FS/FS/API.pm
@@ -721,6 +721,34 @@ sub bill_now {
 
 #next.. Delete Advertising sources?
 
+=item list_advertising_sources OPTION => VALUE, ...
+
+Lists all advertising sources.
+
+=over
+
+=item secret
+
+API Secret
+
+=back
+
+Example:
+
+  my $result = FS::API->list_advertising_sources(
+    'secret'  => 'sharingiscaring',
+  );
+
+  if ( $result->{'error'} ) {
+    die $result->{'error'};
+  } else {
+    # list advertising sources returns an array of hashes for sources.
+    print Dumper($result->{'sources'});
+  }
+
+=cut
+
+#list_advertising_sources
 sub list_advertising_sources {
   my( $class, %opt ) = @_;
   return _shared_secret_error() unless _check_shared_secret($opt{secret});
@@ -735,6 +763,56 @@ sub list_advertising_sources {
   $return;
 }
 
+=item add_advertising_source OPTION => VALUE, ...
+
+Add a new advertising source.
+
+=over
+
+=item secret
+
+API Secret
+
+=item referral
+
+Referral name
+
+=item disabled
+
+Referral disabled, Y for disabled or nothing for enabled
+
+=item agentnum
+
+Agent ID number
+
+=item title
+
+External referral ID
+
+=back
+
+Example:
+
+  my $result = FS::API->add_advertising_source(
+    'secret'     => 'sharingiscaring',
+    'referral'   => 'test referral',
+
+    #optional
+    'disabled'   => 'Y',
+    'agentnum'   => '2', #agent id number
+    'title'      => 'test title',
+  );
+
+  if ( $result->{'error'} ) {
+    die $result->{'error'};
+  } else {
+    # add_advertising_source returns new source upon success.
+    print Dumper($result);
+  }
+
+=cut
+
+#add_advertising_source
 sub add_advertising_source {
   my( $class, %opt ) = @_;
   return _shared_secret_error() unless _check_shared_secret($opt{secret});
@@ -753,6 +831,70 @@ sub add_advertising_source {
   $return;
 }
 
+=item edit_advertising_source OPTION => VALUE, ...
+
+Edit a advertising source.
+
+=over
+
+=item secret
+
+API Secret
+
+=item refnum
+
+Referral number to edit
+
+=item source
+
+hash of edited source fields.
+
+=over
+
+=item referral
+
+Referral name
+
+=item disabled
+
+Referral disabled, Y for disabled or nothing for enabled
+
+=item agentnum
+
+Agent ID number
+
+=item title
+
+External referral ID
+
+=back
+
+=back
+
+Example:
+
+  my $result = FS::API->edit_advertising_source(
+    'secret'     => 'sharingiscaring',
+    'refnum'     => '4', # referral number to edit
+    'source'     => {
+       #optional
+       'referral'   => 'test referral',
+       'disabled'   => 'Y',
+       'agentnum'   => '2', #agent id number
+       'title'      => 'test title',
+    }
+  );
+
+  if ( $result->{'error'} ) {
+    die $result->{'error'};
+  } else {
+    # edit_advertising_source returns updated source upon success.
+    print Dumper($result);
+  }
+
+=cut
+
+#edit_advertising_source
 sub edit_advertising_source {
   my( $class, %opt ) = @_;
   return _shared_secret_error() unless _check_shared_secret($opt{secret});

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

Summary of changes:
 FS/FS/API.pm |  142 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 142 insertions(+)




More information about the freeside-commits mailing list