routePlanningRepHistory
Requires permission visits:journey-plan:manage.
Returns one rep's route history over a window of at most 92 days, a row per day, and where their plan stands now: upcoming stops, missed stops, customers the planner deferred and customers due with nothing planned. The rep must be in the caller's team. Requires permission to manage journey plans.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query RoutePlanningRepHistory($from: DateTime!, $repId: ID!, $to: DateTime!) {
routePlanningRepHistory(from: $from, repId: $repId, to: $to) {
currencyCode
salesRepName
from
salesRepId
timeZone
to
balance {
dueNotPlanned
nextStopDate
upcomingStops
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query RoutePlanningRepHistory($from: DateTime!, $repId: ID!, $to: DateTime!) {\n routePlanningRepHistory(from: $from, repId: $repId, to: $to) {\n currencyCode\n salesRepName\n from\n salesRepId\n timeZone\n to\n balance {\n dueNotPlanned\n nextStopDate\n upcomingStops\n }\n }\n}",
"variables": {
"from": "2025-01-15T00:00:00Z",
"repId": "id",
"to": "2025-01-15T00:00:00Z"
}
}
EOF
Variables:
{
"from": "2025-01-15T00:00:00Z",
"repId": "id",
"to": "2025-01-15T00:00:00Z"
}
Response:
{
"data": {
"routePlanningRepHistory": {
"currencyCode": "string",
"salesRepName": "string",
"from": "2025-01-15T00:00:00Z",
"salesRepId": "id",
"timeZone": "string",
"to": "2025-01-15T00:00:00Z",
"balance": {
"dueNotPlanned": 0,
"nextStopDate": "2025-01-15T00:00:00Z",
"upcomingStops": 0
}
}
}
}
routePlanningRepHistory(
from: DateTime!
repId: ID!
to: DateTime!
): RoutePlanningRepHistory!
Arguments
routePlanningRepHistory.from ● DateTime! non-null scalar
The first day of the window.
routePlanningRepHistory.repId ● ID! non-null scalar
The ID of the sales rep.
routePlanningRepHistory.to ● DateTime! non-null scalar
The last day of the window.
Type
RoutePlanningRepHistory object
A rep's route history over a window, and the balance of their plan.