Sales: 603-546-6751




The Handshake


The first step in any interaction is the Box Tracker handshake. Here you will submit the user name from your static IP Address and the system will respond with a JSON that includes:

Arguments Req Data Type Example
command Y N/A cmdBoxTWebAPIHandShake
username Y N/A to be issued
password Y N/A to be issued

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
sessionKey SEFhbsefjhDSCuu74g Identifies the session at Box Tracker. Sessions last 5 minutes unless they are kept alive with subsequent requests
txnClasses [] An array of strings that can be used as tax selectors

Sample Code ( Perl ):

     use strict; 
     use LWP::UserAgent;
     use Data::Dumper; 
     use JSON;  
     use URI::Encode qw(uri_decode uri_encode ); 

     my $destination; 

     my %fields = ( 
          command   => 'cmdBoxTWebAPIHandShake', 
          username  => "username", 
          password  => "password" );  

     my @args = (); 

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

     my $queryString = join('&', @args );  

     $destination     = "$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 ]);