summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2017-08-21 11:42:36 -0400
committerChristopher Burger <burgerc@freeside.biz>2017-08-22 07:25:20 -0400
commitf633e15977df07607b8b91782237f919328e6cc9 (patch)
treef69ef8bd2cd6e1ecadfebd12cace13f5bd76c304 /bin
parent60379ff3215e4bfe644c4777e8156195133d9c49 (diff)
RT# 27969 - created 3 new api functions to add, edit and list advertising sources
Diffstat (limited to 'bin')
-rwxr-xr-xbin/xmlrpc-advertising_sources-add.pl28
-rwxr-xr-xbin/xmlrpc-advertising_sources-edit.pl30
-rwxr-xr-xbin/xmlrpc-advertising_sources-list.pl22
3 files changed, 80 insertions, 0 deletions
diff --git a/bin/xmlrpc-advertising_sources-add.pl b/bin/xmlrpc-advertising_sources-add.pl
new file mode 100755
index 000000000..4800ad0c7
--- /dev/null
+++ b/bin/xmlrpc-advertising_sources-add.pl
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+
+use strict;
+use Frontier::Client;
+use Data::Dumper;
+
+my $uri = new URI 'http://localhost:8008/';
+
+my $server = new Frontier::Client ( 'url' => $uri );
+
+my $result = $server->call(
+ 'FS.API.add_advertising_source',
+ 'secret' => 'MySecretCode',
+ 'source' => {
+ 'referral' => 'API test referral',
+ 'disabled' => '',
+ 'agentnum' => '',
+ 'title' => 'API test title',
+ },
+);
+
+die $result->{'error'} if $result->{'error'};
+
+print Dumper($result);
+
+print "\nAll Done\n";
+
+exit; \ No newline at end of file
diff --git a/bin/xmlrpc-advertising_sources-edit.pl b/bin/xmlrpc-advertising_sources-edit.pl
new file mode 100755
index 000000000..80f9139c1
--- /dev/null
+++ b/bin/xmlrpc-advertising_sources-edit.pl
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+
+use strict;
+use Frontier::Client;
+use Data::Dumper;
+
+my $uri = new URI 'http://localhost:8008/';
+
+my $server = new Frontier::Client ( 'url' => $uri );
+
+my $result = $server->call(
+ 'FS.API.edit_advertising_source',
+ 'secret' => 'MySecretCode',
+ 'refnum' => '4',
+ 'source' => {
+ 'referral' => 'Edit referral',
+ 'title' => 'Edit Referral title',
+ #'disabled' => 'Y',
+ #'disabled' => '',
+ #'agentnum' => '2',
+ },
+);
+
+die $result->{'error'} if $result->{'error'};
+
+print Dumper($result);
+
+print "\nAll Done\n";
+
+exit; \ No newline at end of file
diff --git a/bin/xmlrpc-advertising_sources-list.pl b/bin/xmlrpc-advertising_sources-list.pl
new file mode 100755
index 000000000..317a38b7b
--- /dev/null
+++ b/bin/xmlrpc-advertising_sources-list.pl
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+use strict;
+use Frontier::Client;
+use Data::Dumper;
+
+my $uri = new URI 'http://localhost:8008/';
+
+my $server = new Frontier::Client ( 'url' => $uri );
+
+my $result = $server->call(
+ 'FS.API.list_advertising_sources',
+ 'secret' => 'MySecretCode',
+);
+
+die $result->{'error'} if $result->{'error'};
+
+print Dumper($result);
+
+print "\nAll Done\n";
+
+exit; \ No newline at end of file