schedule.route
One day's visits as a route: stops in time order with the customer's name, phone and address, a map link per stop and one multi-stop driving directions link (first 10 stops). Pick a worker with person_id or mine; the day is in the shop's time zone and defaults to today. Cancelled visits are left out.
When to use it
Read schedule.settings first: it has the shop's time zone, working hours, arrival window and buffer. Use schedule.findTime to get open times that fit the shop's hours, each worker's hours and time off, and visits already booked with the buffer around them, then book with visits.create.
What to tell the owner
Tell them what you found in plain words. Don't read back raw fields.
| Field | Type | Required |
|---|
shop_id | string (uuid) | yes |
date | string (date) | no |
person_id | string (uuid) | no |
mine | boolean | no |
Example
GET https://doingwork.work/v1/schedule/route?shop_id=00000000-0000-4000-8000-000000000000
Output
| Field | Type | Always there |
|---|
date | string (date) | yes |
time_zone | string | yes |
person_id | ['string', 'null', ' ', '(', 'u', 'u', 'i', 'd', ')'] | yes |
stops | array | yes |
stops[].stop | integer | yes |
stops[].visit_id | string (uuid) | yes |
stops[].job_id | string (uuid) | yes |
stops[].starts_at | string (date-time) | yes |
stops[].ends_at | string (date-time) | yes |
stops[].arrive_by | string (date-time) | yes |
stops[].priority | string | yes |
stops[].status | string | yes |
stops[].title | ['string', 'null'] | yes |
stops[].job_summary | ['string', 'null'] | yes |
stops[].customer_name | ['string', 'null'] | yes |
stops[].customer_phone | ['string', 'null'] | yes |
stops[].address | ['string', 'null'] | yes |
stops[].maps_url | ['string', 'null'] | yes |
stops[].assignee_ids | array | yes |
directions_url | ['string', 'null'] | yes |
unaddressed | integer | yes |
{
"date": "...",
"time_zone": "...",
"person_id": "00000000-0000-4000-8000-000000000000",
"stops": [
{
"stop": 1,
"visit_id": "00000000-0000-4000-8000-000000000000",
"job_id": "00000000-0000-4000-8000-000000000000",
"starts_at": "...",
"ends_at": "...",
"arrive_by": "...",
"priority": "...",
"status": "...",
"title": "...",
"job_summary": "...",
"customer_name": "...",
"customer_phone": "...",
"address": "...",
"maps_url": "...",
"assignee_ids": [
"00000000-0000-4000-8000-000000000000"
]
}
],
"directions_url": "...",
"unaddressed": 1
}
Errors
| Code | Status | What to do |
|---|
invalid_input, invalid_token, rate_limited | | Can happen on any call. See errors. |