Scheduling
spot
7 endpoints. Start at search to collect IDs, then resolve them through get.
Read operations
search spot
Provide a set of parameters which will return a list of ids. There is no limit to the number of IDs this will return. You can then supply these ids to the get endpoint in order to retrieve bulk data. Every parameter available supports a simple value OR a powerful query object that gives you access to all basic comparators.
Example
dateAdded={"operator":">","value":"2016-01-01"}Example
dateAdded={"operator\":\"BETWEEN\",\"value\":[\"2016-05-12\",\"2016-05-13\"]}Available operators
><>=<==!=INBETWEENLIKESTARTSWITHENDSWITHCONTAINSEach of the search endpoints allows for an optional parameter 'includeData'. When sent, the API will additionally send the resolved objects for the first 1000 IDs.
Keep in mind when using 'includeData' that if there are more than 1000 items an additional property '{entity}IDsNoDataExported' will specify the items that are not included in the resolved data array. If the includeData flag is set the additional parameters from getData (latitude, longitude, and maxDistance) can be used.
Parameters
officeIDsintegerNo description in the upstream reference.
spotIDsintegerPrimary key for spots.
datestringNo description in the upstream reference.
apiCanSchedulebooleanSend as 1 to retrieve only routes that the API can schedule for.
assignedTechintegerNo description in the upstream reference.
routeIDintegerPrimary key for routes.
routeIDsintegerPrimary key for routes.
reservedintegerPrimary key for routes.
Returns
spotIDsarrayNo description in the upstream reference.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/spot/search' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'officeIDs=1' \
--data-urlencode 'spotIDs=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
get spot
Get Bulk data for spot. Accepts an array of spotIDs. Returns a max of 1000 records. This function has additional non-standard filters Latitude and Longitude for distance calculation. If these are not specified the office location will be used.
Parameters
spotIDsarrayNo description in the upstream reference.
latitudedoubleLatitude for distance calculcations. If not specified, the office longitude will be used
longitudedoubleLongitude for distance calculcations. If not specified, the office longitude will be used
maxDistanceintegerMaximum number of miles from the previous spot to return.
ignoreInitialDriveTimeintegerIf sent as 1 the start and end of the route will be ignored for distanceToClosest and maxDistance once the route has an appointment on it. This strategy can be beneficial technicians are driving a long distance to their first appointment, then servicing locally from there.
openintegerSet as 1 to return only open routes from the GET
Returns
spotIDintegerNo description in the upstream reference.
routeIDintegerNo description in the upstream reference.
datestringNo description in the upstream reference.
startstringNo description in the upstream reference.
endstringNo description in the upstream reference.
spotCapacityintegerNo description in the upstream reference.
descriptionstringNo description in the upstream reference.
currentAppointmentintegerNo description in the upstream reference.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/spot/get' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'spotIDs=value' \
--data-urlencode 'latitude=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Fetch by id spot
Get spot data for single ID -- please provide a specific record ID in the URL structure. This function has additional non-standard filters Latitude and Longitude for distance calculation. If these are not specified the office location will be used.
Parameters
latitudedoubleLatitude for distance calculcations. If not specified, the office longitude will be used
longitudedoubleLongitude for distance calculcations. If not specified, the office longitude will be used
maxDistanceintegerMaximum number of miles from the previous spot to return.
ignoreInitialDriveTimeintegerIf sent as 1 the start and end of the route will be ignored for distanceToClosest and maxDistance once the route has an appointment on it. This strategy can be beneficial technicians are driving a long distance to their first appointment, then servicing locally from there.
openintegerSet as 1 to return only open routes from the GET
Returns
spotIDintegerNo description in the upstream reference.
routeIDintegerNo description in the upstream reference.
datestringNo description in the upstream reference.
startstringNo description in the upstream reference.
endstringNo description in the upstream reference.
spotCapacityintegerNo description in the upstream reference.
descriptionstringNo description in the upstream reference.
currentAppointmentintegerNo description in the upstream reference.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/spot/{id}' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'latitude=value' \
--data-urlencode 'longitude=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Write operations
block spot
Block spots
Parameters
spotIDintegerForeign key to spots table
spotIDsarrayArray of additional spotIDs to block
descriptionarrayBlock description default: Break
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/spot/block' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'spotID=1' \
--data-urlencode 'spotIDs=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
reserve spot
Reserve a spot until a particular time
Parameters
spotIDintegerForeign key to spots table
spotOptionsarrayArray of spotIDs. If sent, the first available spotID in this set will be reserved duration - integer - required duration of the lock in minutes
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/spot/reserve' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'spotID=1' \
--data-urlencode 'spotOptions=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Destructive operations
release spot
Release reservations on a spot
Parameters
spotIDintegerForeign key to spots table
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/spot/release' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'spotID=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
unblock spot
unblock spots
Parameters
spotIDintegerForeign key to spots table
spotIDsarrayArray of additional spotIDs to unblock
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/spot/unblock' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'spotID=1' \
--data-urlencode 'spotIDs=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response