General:
Services:
Resources:
The Customer Handshake
Endpoint: https://www.dumpster.software/controller.html.
The second step in any interaction is the Box Tracker Customer Handshake. Here you will submit the following arguments and the system will respond with a JSON that includes:
Arguments | Req | Data Type | Example |
---|---|---|---|
command | Y | N/A | cmdBoxTPortalCustomerHandShake |
username_api | Y | N/A | Same as the handshake |
password_api | Y | N/A | Same as the handshake |
session_key_api | Y | N/A | Value return from the initial handshake |
username_customer | Y | N/A | To be issued |
password_customer | Y (if) | N/A | To be issued and only required (if you dont have a customer session key) |
session_key_customer | N | N/A | Provided by the first call to 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 |
sessionKey | SEFhbsefjhDSCuu74g | Identifies the session at Box Tracker. Sessions last 5 minutes unless they are kept alive with subsequent requests |
customerID | 13913 | Identifies the haulers customer at Box Tracker. |
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 => "cmdBoxTPortalCustomerHandShake", username_api => "username_api", password_api => "password_api", session_key_api => "session_key_api", username_customer => "username_customer", password_customer => "password_customer", session_key_customer => "session_key_customer" ); 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]);