Your First API Call
Test the Fill solver with a single command:
curl https://api.solvice.io/v2/fill/demo -H "Authorization: YOUR_API_KEY" | \
curl https://api.solvice.io/v2/fill/solve -H "Authorization: YOUR_API_KEY" \
-X POST -H "Content-Type: application/json" -d @-
This fetches a demo problem and solves it immediately. Replace YOUR_API_KEY with your actual API key from the dashboard.
Basic Fill Request
A Fill request requires two things: employees (your workforce) and shifts (time slots to fill).
{
"employees": [
{
"name": "Alice",
"skills": [{ "name": "kitchen" }]
},
{
"name": "Bob",
"skills": [{ "name": "bar" }]
}
],
"shifts": [
{
"name": "morning-kitchen",
"from": "2024-04-18T08:00:00",
"to": "2024-04-18T14:00:00",
"skills": [{ "name": "kitchen" }],
"min": 1,
"max": 1
},
{
"name": "evening-bar",
"from": "2024-04-18T18:00:00",
"to": "2024-04-18T23:00:00",
"skills": [{ "name": "bar" }],
"min": 1,
"max": 1
}
]
}
Understanding the Response
The solver returns optimized shift assignments:
{
"score": {
"hardScore": 0,
"mediumScore": 0,
"softScore": -2,
"feasible": true
},
"assignments": [
{
"shift": "morning-kitchen",
"from": "2024-04-18T08:00:00",
"to": "2024-04-18T14:00:00",
"skills": ["kitchen"],
"employee": "Alice"
},
{
"shift": "evening-bar",
"from": "2024-04-18T18:00:00",
"to": "2024-04-18T23:00:00",
"skills": ["bar"],
"employee": "Bob"
}
]
}
true if all hard constraints are satisfied (skills match, no conflicts)
List of shift-employee pairings with timing details
Key Concepts
| Concept | Description |
|---|
| Employee | A worker with skills who can be assigned to shifts |
| Shift | A time slot requiring specific skills and number of workers |
| Skills | Capabilities that match employees to appropriate shifts |
| Score | Solution quality indicator (hard/medium/soft constraints) |
Next Steps