This API endpoint is designed to distribute a set of jobs across specified regions or clusters.
REQUEST
POST https://api.hellotracks.com/api/distributejobs
{
data: {
jobs: [
"<job_id_1>",
"<job_id_2>",
...
"<job_id_n>"
],
regions: 5,
max: 10,
method: "distance",
}
}
Number of regions/clusters to split all jobs ids into.
The maximum number of jobs per cluster.
Assignment method: distance
, zones
, or size
.
RESPONSE
{
"status": 0,
"clusters": [
{
"center_lat": <latitude>,
"center_lng": <longitude>,
"jobs" ["<job_id>",...,""<job_id>""],
"method": <String> (optional), // one of "distance", "zones", "size"
},
...
{ ... }
]
}
An array of clusters, each containing center coordinates (latitude and longitude), assigned job IDs, and the distribution method used.