Field service solver
Optimize routes for field technicians, service vehicles, and mobile workers. PlanSolve's field service model handles complex constraints including time windows, skill requirements, vehicle capacity, and real-time traffic conditions.
API Overview
PlanSolve uses an asynchronous API pattern for field service optimization. Submit your request, monitor progress, and retrieve results when complete.
/api/solve
Submit a field service optimization request
/api/solve/{jobId}
Check the status of an optimization job
/api/solve/{jobId}/result
Retrieve the completed optimization results
/api/solve/{jobId}/analyze
Analyze the optimization results
API Workflow
All PlanSolve optimization APIs follow the same workflow. Understanding this process will help you integrate the API effectively.
Construct Request
Build your optimization request with vehicles, visits, and constraints
Start Solver
Submit the request to start the optimization process
Poll Status
Check the status until the solver completes
Get Results
Retrieve the optimized routes and schedules
Workflow Details
Step 1: Create your request object with vehicle data (locations, skills, shifts, capacity) and visit data (locations, time windows, required skills, service duration).
Step 2: Send a POST request to /api/solve
with your request data. The API will return a job ID.
Step 3: Poll the status endpoint /api/solve/{jobId}
until the status changes from "solving" to "completed".
Step 4: Once completed, retrieve the results from /api/solve/{jobId}/result
to get the optimized routes and schedules.
API Parameters
The field service optimization API accepts these key parameters to define your optimization problem. Each parameter plays a crucial role in determining the optimal solution.
Main Parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
vehicles | array | Required | Array of vehicles/technicians with their constraints and capabilities | [{ "id": "tech1", "homeLocation": [lat, lng], "skills": ["repair"], "shifts": [...] }] |
visits | array | Required | Array of customer visits with locations, time windows, and requirements | [{ "id": "visit1", "location": [lat, lng], "timeWindows": [...], "requiredSkills": ["repair"] }] |
startDateTime | ISO 8601 | Required | Start time for the optimization period | "2024-01-15T08:00:00" |
endDateTime | ISO 8601 | Required | End time for the optimization period | "2024-01-15T18:00:00" |
southWestCorner | array[number] | Optional | Southwest boundary coordinates [lat, lng] for the service area | [40.74, -74.01] |
northEastCorner | array[number] | Optional | Northeast boundary coordinates [lat, lng] for the service area | [40.76, -73.98] |
Vehicle Parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
id | string | Required | Unique identifier for the vehicle/technician | "tech1" |
homeLocation | array[number] | Required | Starting location coordinates [lat, lng] | [40.7128, -74.0060] |
skills | array[string] | Optional | List of skills the technician possesses | ["repair", "installation"] |
shifts | array[object] | Required | Array of work shifts with time constraints | [{"id": "morning", "minStartTime": "08:00", "maxEndTime": "17:00"}] |
Visit Parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
id | string | Required | Unique identifier for the visit | "visit1" |
name | string | Optional | Human-readable name for the visit | "Customer Repair" |
location | array[number] | Required | Visit location coordinates [lat, lng] | [40.7589, -73.9851] |
timeWindows | array[object] | Optional | Available time slots for the visit | [{"minStartTime": "09:00", "maxEndTime": "17:00"}] |
serviceDuration | string | Required | Duration of service in ISO 8601 format | "PT30M" |
priority | string | Optional | Visit priority level (HIGH, MEDIUM, LOW) | "HIGH" |
requiredSkills | array[string] | Optional | Skills required to complete this visit | ["repair"] |
JSON Request Structure
Understand the complete structure of a field service optimization request. This example shows all the key components and their relationships.
{ "vehicles": [ { "id": "tech1", "homeLocation": [40.7128, -74.0060], "skills": ["repair", "installation"], "shifts": [ { "id": "morning", "minStartTime": "08:00", "maxEndTime": "17:00" } ] } ], "visits": [ { "id": "visit1", "name": "Customer Repair", "location": [40.7589, -73.9851], "timeWindows": [ { "minStartTime": "09:00", "maxEndTime": "17:00" } ], "serviceDuration": "PT30M", "priority": "HIGH", "requiredSkills": ["repair"] } ], "startDateTime": "2024-01-15T08:00:00", "endDateTime": "2024-01-15T18:00:00", "southWestCorner": [40.74, -74.01], "northEastCorner": [40.76, -73.98] }
Ready to Optimize Your Field Service?
Start with our quick start guide to implement field service optimization in your application.