- [Resource: Trip](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Trip)
  - [JSON representation](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Trip.SCHEMA_REPRESENTATION)
- [TripConfig](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#TripConfig)
  - [JSON representation](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#TripConfig.SCHEMA_REPRESENTATION)
- [AuthToken](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#AuthToken)
  - [JSON representation](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#AuthToken.SCHEMA_REPRESENTATION)
- [State](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#State)
- [TripExecution](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#TripExecution)
  - [JSON representation](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#TripExecution.SCHEMA_REPRESENTATION)
- [Location](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Location)
  - [JSON representation](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Location.SCHEMA_REPRESENTATION)
- [LatLng](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#LatLng)
  - [JSON representation](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#LatLng.SCHEMA_REPRESENTATION)
- [Stop](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Stop)
  - [JSON representation](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Stop.SCHEMA_REPRESENTATION)
- [Route](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Route)
  - [JSON representation](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Route.SCHEMA_REPRESENTATION)
- [SimplePolyline](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#SimplePolyline)
  - [JSON representation](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#SimplePolyline.SCHEMA_REPRESENTATION)
- [SpeedReadingInterval](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#SpeedReadingInterval)
  - [JSON representation](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#SpeedReadingInterval.SCHEMA_REPRESENTATION)
- [Speed](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Speed)
- [RouteDeviation](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#RouteDeviation)
  - [JSON representation](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#RouteDeviation.SCHEMA_REPRESENTATION)
- [TriggerSource](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#TriggerSource)
- [Methods](https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#METHODS_SUMMARY)

## Resource: Trip

A trip.

| JSON representation |
|---|
| ``` { "name": string, "config": { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#TripConfig`) }, "androidAppId": string, "iosAppId": string, "authToken": { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#AuthToken`) }, "state": enum (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#State`), "execution": { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#TripExecution`) }, "createTime": string, "updateTime": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Identifier. The resource name of the trip. Format: projects/{project_number}/trips/{tripId}. |
| `config` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#TripConfig`)`` Immutable. The configuration for the trip. |
| `androidAppId` | `string` Input only. Immutable. The Android application ID of the mobile application that will use the trip. At least one of `androidAppId` or `iosAppId` must be set. |
| `iosAppId` | `string` Input only. Immutable. The iOS bundle ID of the mobile application that will use the trip. At least one of `androidAppId` or `iosAppId` must be set. |
| `authToken` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#AuthToken`)`` Output only. An opaque token that authorizes access to begin a NavConnect trip in Google Maps or Waze and grants these applications access to update the trip. Only returned by `trips.create`. |
| `state` | ``enum (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#State`)`` Output only. The Trip state. |
| `execution` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#TripExecution`)`` Output only. The latest data about the execution of the trip. This may not be set if the trip is in an error state. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Time according to the server when the trip was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Time at which the server received the latest trip update. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

## TripConfig

Configuration for the trip.

| JSON representation |
|---|
| ``` { "enableHighFrequencyUpdates": boolean, "enablePubsub": boolean, "pubsubFieldMask": string, "enableRemainingRouteReporting": boolean, "enableRouteDeviationReporting": boolean } ``` |

| Fields ||
|---|---|
| `enableHighFrequencyUpdates` | `boolean` Optional. Whether to enable high-frequency trip updates. NOTE: Enabling this feature logs the trip under Enterprise Tier usage, and is subject to Enterprise Tier rates. |
| `enablePubsub` | `boolean` Optional. Whether to enable pubsub notifications for the trip. |
| `pubsubFieldMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Optional. If set, only the specified subset of the Trip fields will be included in the pubsub notifications. If not set, all Trip fields will be included in the pubsub notifications (default behavior). The following fields are not supported: - `androidAppId` - `iosAppId` - `authToken` - `config` NOTE: This field is ignored if `enablePubsub` is false. This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |
| `enableRemainingRouteReporting` | `boolean` Optional. Whether to enable remaining route reporting for the trip. NOTE: Enabling this feature logs the trip under Enterprise Tier usage, and is subject to Enterprise Tier rates. |
| `enableRouteDeviationReporting` | `boolean` Optional. Whether to enable route deviation reporting for the trip. NOTE: Enabling this feature logs the trip under Enterprise Tier usage, and is subject to Enterprise Tier rates. |

## AuthToken

An authentication token.

| JSON representation |
|---|
| ``` { "token": string, "expireTime": string } ``` |

| Fields ||
|---|---|
| `token` | `string` Output only. The authentication token that should be passed to the mobile application. |
| `expireTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Time at which the authentication token will expire. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

## State

All possible trip states.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | The trip state is unspecified. |
| `NEW` | The trip was created but has not yet started. |
| `ENROUTE` | The transporter is enroute to the destination. |
| `ARRIVED` | The transporter arrived at the destination. |
| `SUSPENDED` | The trip was suspended. |
| `FAILED` | The trip failed to complete successfully. |
| `CLIENT_ERROR` | The trip failed due to a client error. |
| `CANCELED` | The trip was explicitly canceled by the developer. |

## TripExecution

Data about the execution of the trip.

| JSON representation |
|---|
| ``` { "origin": { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Location`) }, "destination": { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Stop`) }, "location": { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Location`) }, "remainingRoute": { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Route`) }, "lastRouteDeviation": { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#RouteDeviation`) }, "traveledDuration": string, "remainingDuration": string, "traveledDistanceMeters": integer, "remainingDistanceMeters": integer, "stopAddedInRoute": boolean } ``` |

| Fields ||
|---|---|
| `origin` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Location`)`` Output only. Origin of the trip which is generally the transporter's location at start of the NavConnect trip. |
| `destination` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Stop`)`` Output only. The destination of the trip as reported by the mobile application. |
| `location` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Location`)`` Output only. The location signal representing the last known location of the transporter. This will be the road snapped location if available. |
| `remainingRoute` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Route`)`` Output only. Provides the polyline for the remaining portion of the route. |
| `lastRouteDeviation` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#RouteDeviation`)`` Output only. The most recent route deviation event captured during the trip. |
| `traveledDuration` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` Output only. Time traveled thus far. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `remainingDuration` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` Output only. Time left on this trip as estimated by Google. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `traveledDistanceMeters` | `integer` Output only. Distance traveled from the origin in meters. |
| `remainingDistanceMeters` | `integer` Output only. Distance remaining to the destination in meters. |
| `stopAddedInRoute` | `boolean` Output only. Indicates whether a stop was added along the route. |

## Location

A location as reported by the mobile application.

| JSON representation |
|---|
| ``` { "point": { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#LatLng`) }, "sourceTime": string, "serverTime": string } ``` |

| Fields ||
|---|---|
| `point` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#LatLng`)`` Output only. The location lat/lng. |
| `sourceTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when the location was sourced as denoted by the client. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `serverTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time at which the server received this location update. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

## LatLng

An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the [WGS84 standard](https://en.wikipedia.org/wiki/World_Geodetic_System#1984_version). Values must be within normalized ranges.

| JSON representation |
|---|
| ``` { "latitude": number, "longitude": number } ``` |

| Fields ||
|---|---|
| `latitude` | `number` The latitude in degrees. It must be in the range \[-90.0, +90.0\]. |
| `longitude` | `number` The longitude in degrees. It must be in the range \[-180.0, +180.0\]. |

## Stop

A stop in the trip where some task is to be performed.

| JSON representation |
|---|
| ``` { "point": { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#LatLng`) } } ``` |

| Fields ||
|---|---|
| `point` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#LatLng`)`` Required. The location of the stop as a lat/lng. |

## Route

A route polyline.

| JSON representation |
|---|
| ``` { "trafficInformation": [ { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#SpeedReadingInterval`) } ], // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "simplePolyline": { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#SimplePolyline`) }, "encodedPolyline": string, "s2Polyline": string, "geoJson": { object } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `trafficInformation[]` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#SpeedReadingInterval`)`` Output only. Traffic information on the polyline described as speed reading intervals. NOTES: - The intervals are non-overlapping. - The intervals are contiguous. - The intervals cover the entire polyline. - The intervals are sorted by increasing index. - Speed is specified for each interval. |
| The route format. The format populated is controlled by the `route_polyline_format` parameter. If not set, it defaults to a simple polyline. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `simplePolyline` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#SimplePolyline`)`` Output only. The route as a simple list of latlngs. |
| `encodedPolyline` | `string` Output only. The route as an encoded polyline. See <https://developers.google.com/maps/documentation/utilities/polylinealgorithm>. |
| `s2Polyline` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The route as an encoded S2Polyline. See <https://s2geometry.io/devguide/basic_types.html>. A base64-encoded string. |
| `geoJson` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Output only. The route as a GeoJSON LineString. See <https://tools.ietf.org/html/rfc7946#section-3.1.4>. |
| End of mutually exclusive fields. ||

## SimplePolyline

Represents a polyline using a simple list of points.

| JSON representation |
|---|
| ``` { "points": [ { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#LatLng`) } ] } ``` |

| Fields ||
|---|---|
| `points[]` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#LatLng`)`` Output only. Ordered list of points representing the polyline. |

## SpeedReadingInterval

Traffic density indicator on a contiguous segment of a path. Given a path with points P_0, P_1, ... , P_N (zero-based index), the SpeedReadingInterval defines an interval and describes its traffic using the `Speed` categories.

| JSON representation |
|---|
| ``` { "speed": enum (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Speed`), "startPolylinePointIndex": integer, "endPolylinePointIndex": integer } ``` |

| Fields ||
|---|---|
| `speed` | ``enum (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Speed`)`` Output only. Traffic speed in this interval. |
| `startPolylinePointIndex` | `integer` Output only. The starting index of this interval in the path. |
| `endPolylinePointIndex` | `integer` Output only. The ending index of this interval in the path. |

## Speed

The classification of polyline speed based on traffic data.

| Enums ||
|---|---|
| `SPEED_UNSPECIFIED` | The speed is unspecified. |
| `NORMAL` | Normal speed, no traffic delays. |
| `SLOW` | Slowdown detected, light to medium amount of traffic. |
| `TRAFFIC_JAM` | Traffic delays, including standstill traffic. |

## RouteDeviation

Route deviation information.

| JSON representation |
|---|
| ``` { "location": { object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Location`) }, "source": enum (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#TriggerSource`) } ``` |

| Fields ||
|---|---|
| `location` | ``object (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#Location`)`` Output only. Location where the deviation occurred. |
| `source` | ``enum (`https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips#TriggerSource`)`` Output only. Source for the deviation trigger. |

## TriggerSource

The source that triggered the route deviation.

| Enums ||
|---|---|
| `TRIGGER_SOURCE_UNSPECIFIED` | The trigger source is unspecified. |
| `DRIVER_INITIATED_REROUTE` | The route deviation was triggered by the driver (e.g. wrong turn). |
| `SYSTEM_INITIATED_REROUTE` | The route deviation was triggered by the system (e.g. traffic closure). |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips/create` | Creates a trip. |
| ### `https://developers.google.com/maps/documentation/navigation/connect/reference/rest/v1/projects.trips/get` | Gets a trip. |