Contacts
Sales: 603-546-6751
Email: sales@cairnapps.com

General:

Services:

Resources:

The Customer Profile

Endpoint: https://www.dumpster.software/controller.html.

The customer profile will provide the customer information, and allow for updates. Here you will submit the following arguments and the system will respond with a JSON that includes:

Retrieve customer information:

Arguments Req Data Type Example
command Y N/A cmdBoxTPortalCustomerData
username_api Y N/A Same as the handshake
session_key_api Y N/A Provided by handshake
username_customer Y N/A To be issued
session_key_customer Y N/A Provided by customer handshake
customer_id Y int(11) Provided by customer handshake

Box Tracker Response:: A JSON with the following fields:

Field Example Explanation
status 200 See the status code section
errorString ERROR: Invalid Session Key What if anything went wrong
customerObj --- An object that contains all customer information available to the portal

Sample Code ( Perl ):

     #!/usr/bin/perl
     use strict; 
     use LWP::UserAgent;
     use Data::Dumper; 
     use JSON;  
     use URI::Encode qw(uri_decode uri_encode); 

     my $destination; 

     my %fields = ( 
          command => "cmdBoxTPortalCustomerData",
          username_api => "username_api",
          session_key_api => "session_key_api",
          username_customer => "username_customer",
          session_key_customer => "session_key_customer",
          customer_id => "customer_id"
     );  

     my @args = (); 

     foreach my $key (keys %fields) { 
          my $value = uri_encode($fields{$key});  
          push @args, "$key=$value"; 
     }

     my $queryString = join('&', @args);  
     $destination = "https://www.dumpster.software/controller.html?$queryString"; 

     my $ua = LWP::UserAgent->new; 
     my $response =  $ua->request(HTTP::Request->new(GET => $destination));

     my $json = JSON->new(); 
     my $obj = $json->decode($response->content);  

     print Data::Dumper->Dump([$obj]); 

Update customer information:

All original values will be provided by the customer retrieval module (documented above), which will also provide an array of fields that are required when attempting to update customer information. Any field marked as (if) will be required if specified by the required fields array.

Arguments Req Data Type Example
command Y N/A cmdBoxTPortalSaveCustomerProfile
username_api Y N/A Same as the handshake
session_key_api Y N/A Provided by handshake
username_customer Y N/A To be issued
session_key_customer Y N/A Provided by customer handshake
customer_id Y int(11) Provided by customer handshake
customer_name Y (if) varchar(150) John Smith or ABC Company
customer_address Y (if) varchar(100) 123 Main Street
customer_address2 Y (if) varchar(100) Apt 2
customer_city Y (if) varchar(100) Yourtown
customer_state Y (if) varchar(2) VA or AB
customer_zip Y (if) varchar(10) 12345 or H7J1Y6
customer_contact Y (if) varchar(100) Bob
customer_phone Y (if) varchar(50) 1234567890
customer_cell Y (if) varchar(50) 1234567890
customer_fax Y (if) varchar(50) 1234567890
customer_email Y (if) varchar(255) johnsmith@somedomain.com
customer_email_confirm N int(1) 1 or 0
customer_email_thankyou N int(1) 1 or 0
customer_email_reminders N int(1) 1 or 0
customer_sms N int(1) 1 or 0

Box Tracker Response:: A JSON with the following fields:

Field Example Explanation
status 200 See the status code section
errorString ERROR: Invalid Session Key What if anything went wrong

Sample Code ( Perl ):

     #!/usr/bin/perl
     use strict; 
     use LWP::UserAgent;
     use Data::Dumper; 
     use JSON;  
     use URI::Encode qw(uri_decode uri_encode); 

     my $destination; 

     my %fields = ( 
          command => "cmdBoxTPortalSaveCustomerProfile",
          customer_name => "customer_name",
          customer_address => "customer_address",
          customer_address2 => "customer_address2",
          customer_city => "customer_city",
          customer_state => "customer_state",
          customer_zip => "customer_zip",
          customer_contact => "customer_contact",
          customer_phone => "customer_phone",
          customer_cell => "customer_cell",
          customer_fax => "customer_fax",
          customer_email => "customer_email",
          customer_email_confirm => "customer_email_confirm",
          customer_email_thankyou => "customer_email_thankyou",
          customer_email_reminders => "customer_email_reminders",
          customer_sms => "customer_sms",
          username_api => "username_api",
          session_key_api => "session_key_api",
          username_customer => "username_customer",
          session_key_customer => "session_key_customer",
          customer_id => "customer_id"
     );  

     my @args = (); 

     foreach my $key (keys %fields) { 
          my $value = uri_encode($fields{$key});  
          push @args, "$key=$value"; 
     }

     my $queryString = join('&', @args);  
     $destination = "https://www.dumpster.software/controller.html?$queryString"; 

     my $ua = LWP::UserAgent->new; 
     my $response =  $ua->request(HTTP::Request->new(GET => $destination));

     my $json = JSON->new(); 
     my $obj = $json->decode($response->content);  

     print Data::Dumper->Dump([$obj]);