Scheduling
appointment
7 endpoints. Start at search to collect IDs, then resolve them through get.
Read operations
search appointment
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.
Parameters
officeIDintegerNo description in the upstream reference.
officeIDsintegerNo description in the upstream reference.
appointmentIDsintegerUnique ID
statusintegerThe status of an appointment which can include:<ul><li>0: Pending</li><li>1: Completed</li><li>2: No Show</li><li>-2: Rescheduled</li><li>-1: Cancelled</li></ul>
customerIDsintegerCustomer who owns this appointment
subscriptionIDsintegerSubscription who owns this appointment. Appointments that are attached to subscriptions inherit the subscriptions pricing templates and other defaults as well as update the subscriptions next service dates upon completion. Re-services and stand-alone services are NOT attached to subscriptions.
spotIDsintegerSpot ID the appointment is assigned to.
routeIDsintegerRoute the appointment is assigned to.
Returns
appointmentIDsarrayNo description in the upstream reference.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/appointment/search' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'officeID=1' \
--data-urlencode 'officeIDs=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
get appointment
Get Bulk data for appointment. Accepts an array of appointmentIDs. Returns a max of 1000 records.
Parameters
appointmentIDsarrayNo description in the upstream reference.
includeCancellationReasonintegerSend as 1 to retrieve an additional field cancellationReason.
includeTargetPestsintegerSend as 1 to retrieve an additional field targetPests as an array of integers.
includeCustomFieldsintegerSend as 1 to retrieve an additional field customFields as an array of Custom Fields names and values.
Returns
appointmentIDintegerUnique Identifier
officeIDintegerThe ID of the office this appointment belongs to.
customerIDintegerThe ID of the customer this appointment belongs to.
subscriptionIDintegerThe ID of the subscription if this appointment belongs to a subscription. If an appointment is attached to a subscription it inherits its pricing as well as other defaults. It also resets the next due date upon completion. Stand alone services or reservices will be a -1.
subscriptionRegionIDintegerRegionID of the subscription if this appointment belongs to a one. For stand alone services or reservices it will be -1.
routeIDintegerThe ID of the route that this appointment is assigned to.
spotIDintegerThe ID of the spot that this appointment is assigned to. Null indicates an appointment that is flexible on route.
datestringThe date this appointment is scheduled for.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/appointment/get' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'appointmentIDs=value' \
--data-urlencode 'includeCancellationReason=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Fetch by id appointment
Get appointment data for single ID -- please provide a specific record ID in the URL structure.
Parameters
includeCancellationReasonintegerSend as 1 to retrieve an additional field cancellationReason.
includeTargetPestsintegerSend as 1 to retrieve an additional field targetPests as an array of integers.
includeCustomFieldsintegerSend as 1 to retrieve an additional field customFields as an array of Custom Fields names and values.
Returns
appointmentIDintegerUnique Identifier
officeIDintegerThe ID of the office this appointment belongs to.
customerIDintegerThe ID of the customer this appointment belongs to.
subscriptionIDintegerThe ID of the subscription if this appointment belongs to a subscription. If an appointment is attached to a subscription it inherits its pricing as well as other defaults. It also resets the next due date upon completion. Stand alone services or reservices will be a -1.
subscriptionRegionIDintegerRegionID of the subscription if this appointment belongs to a one. For stand alone services or reservices it will be -1.
routeIDintegerThe ID of the route that this appointment is assigned to.
spotIDintegerThe ID of the spot that this appointment is assigned to. Null indicates an appointment that is flexible on route.
datestringThe date this appointment is scheduled for.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/appointment/{id}' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'includeCancellationReason=1' \
--data-urlencode 'includeTargetPests=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Write operations
create appointment
Parameters
startstringStart Time Window
endstringEnd Time Window
durationintegerNumber of minutes this appointment should last
employeeIDintegeremployeeID to whom this appointment belongs
notesstringAppointment Notes spotID - Specify to fix this appointment to a spot
routeIDintegerSpecify to fix this appointment on a route.
callAheadintegerNumber of minutes ahead of the appointment start time to call
subscriptionIDintegerSpecify the subscriptionID this appointment is associated with
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/appointment/create' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'start=value' \
--data-urlencode 'end=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
update appointment
Parameters
customerIDintegercustomerID associated with the appointment
typeintegerserviceID to perform
startstringStart Time Window
endstringEnd Time Window
durationintegerNumber of minutes this appointment should last
employeeIDintegeremployeeID to whom this appointment belongs
notesstringAppointment Notes spotID - Specify to fix this appointment to a spot
routeIDintegerSpecify to fix this appointment on a route.
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/appointment/update' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'customerID=1' \
--data-urlencode 'type=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
complete appointment
Complete specified appointmentID
Parameters
statusintegerThe status of an appointment which can include:0: Pending, 1: Completed, 2: No Show
completionNotesstringNo description in the upstream reference.
officeNotesstringNo description in the upstream reference.
flagNotesstringNo description in the upstream reference.
timeInstringNo description in the upstream reference.
timeOutstringNo description in the upstream reference.
checkInstringNo description in the upstream reference.
checkOutstringNo description in the upstream reference.
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/appointment/complete' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'status=1' \
--data-urlencode 'completionNotes=value' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response
Destructive operations
cancel appointment
Cancel specified appointmentID
Parameters
cancelReasonstringCancel Reason
cancelledByintegeremployeeID that cancelled the appointment
Returns
Returns a success acknowledgement.
Request
curl -X POST 'https://{subdomain}.pestroutes.com/api/appointment/cancel' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode 'cancelReason=value' \
--data-urlencode 'cancelledBy=1' \
--data-urlencode 'authenticationKey=<your-key>' \
--data-urlencode 'authenticationToken=<your-token>'Response