Customer Job Sites
Endpoint: https://www.dumpster.software/controller.html.
Provides a list of job sites, a single job site based on a valid id and allows for update.
Here you will submit the following arguments and the system will respond with a JSON that includes:
Retrieve job sites (list):
The job site list will provide a list of job sites, however, it will do so 50
records at a time. The offset argument will allow developers to control the starting
point in which the database will start generating records.
Arguments |
Req |
Data Type |
Example |
command |
Y |
N/A |
cmdBoxTPortalJobsiteList |
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 |
offset |
Y |
int(11) |
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 |
jobSiteObjList |
--- |
An object that contains all customer job sites 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 => "cmdBoxTPortalJobsiteList",
username_api => "username_api",
session_key_api => "session_key_api",
username_customer => "username_customer",
session_key_customer => "session_key_customer",
customer_id => "customer_id",
offset => "offset"
);
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]);
Retrieve job site (single):
Arguments |
Req |
Data Type |
Example |
command |
Y |
N/A |
cmdBoxTPortalJobsiteData |
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 |
jobsite_id |
Y |
int(11) |
54321 |
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 |
jobSiteObj |
--- |
An object that contains all information belonging to the target job site
|
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 => "cmdBoxTPortalJobsiteData",
username_api => "username_api",
session_key_api => "session_key_api",
username_customer => "username_customer",
session_key_customer => "session_key_customer",
jobsite_id => "jobsite_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 job sites:
All original values will be provided by the job site retrieval modules (documented above). The single job site
module will also provide an array of fields that are required when attempting to update job site 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 |
cmdBoxTPortalSaveJobSite |
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 |
jobsite_id |
Y |
int(11) |
12345 |
jobsite_address |
Y (if) |
varchar(100) |
123 Main Street |
jobsite_city |
Y (if) |
varchar(100) |
Yourtown |
jobsite_state |
Y (if) |
varchar(2) |
VA or AB |
jobsite_zip |
Y (if) |
varchar(10 |
12345 or H7J1Y6 |
jobsite_county |
Y (if) |
varchar(50) |
YourCounty |
jobsite_muni |
Y (if) |
varchar(100) |
YourMunicipal |
jobsite_po |
Y (if) |
varchar(50) |
PO Box 12345 |
jobsite_cross_street |
Y (if) |
varchar(100) |
123 Main Street |
jobsite_contact |
Y (if) |
varchar(100) |
Bob |
jobsite_contact_cell |
Y (if) |
varchar(50) |
1234567890 |
jobsite_hazzards |
N |
text |
Watch out for children in the yard |
jobsite_billing_note |
N |
text |
Please place on right side of driveway by the red door |
jobsite_leed |
N |
int(1) |
0 or 1 |
jobsite_validated |
N |
int(1) |
0 or 1 |
Box Tracker Response:: A JSON with the following fields:
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 => "cmdBoxTPortalSaveJobSite",
jobsite_id => "jobsite_id",
jobsite_address => "jobsite_address",
jobsite_city => "jobsite_city",
jobsite_state => "jobsite_state",
jobsite_zip => "jobsite_zip",
jobsite_county => "jobsite_county",
jobsite_muni => "jobsite_muni",
jobsite_po => "jobsite_po",
jobsite_cross_street => "jobsite_cross_street",
jobsite_contact => "jobsite_contact",
jobsite_contact_cell => "jobsite_contact_cell",
jobsite_hazzards => "jobsite_hazzards",
jobsite_billing_note => "jobsite_billing_note",
jobsite_leed => "jobsite_leed",
jobsite_validated => "jobsite_validated",
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]);