REST Resource: projects.trips

Resource: Trip

A trip.

JSON representation
{
  "name": string,
  "config": {
    object (TripConfig)
  },
  "androidAppId": string,
  "iosAppId": string,
  "authToken": {
    object (AuthToken)
  },
  "state": enum (State),
  "execution": {
    object (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 (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 (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 (State)

Output only. The Trip state.

execution

object (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 (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 (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
}
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 (FieldMask 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".

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 (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.

TripExecution

Data about the execution of the trip.

JSON representation
{
  "origin": {
    object (Location)
  },
  "destination": {
    object (Stop)
  },
  "location": {
    object (Location)
  },
  "traveledDuration": string,
  "remainingDuration": string,
  "traveledDistanceMeters": integer,
  "remainingDistanceMeters": integer,
  "stopAddedInRoute": boolean
}
Fields
origin

object (Location)

Output only. Origin of the trip which is generally the transporter's location at start of the NavConnect trip.

destination

object (Stop)

Output only. The destination of the trip as reported by the mobile application.

location

object (Location)

Output only. The location signal representing the last known location of the transporter. This will be the road snapped location if available.

traveledDuration

string (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 (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 (LatLng)
  },
  "sourceTime": string,
  "serverTime": string
}
Fields
point

object (LatLng)

Output only. The location lat/lng.

sourceTime

string (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 (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. 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 (LatLng)
  }
}
Fields
point

object (LatLng)

Required. The location of the stop as a lat/lng.

Methods

create

Creates a trip.

get

Gets a trip.