3.29.5
Root of the Track API resources
Extends Resource
(any)
Creates a new Track resource
(Object?)
Options for the Track API
Name | Description |
---|---|
options.autoRenew Boolean
(default true )
|
Determines whether to automatically renew a token when it nears its expiration |
options.autoRenewMinutesBeforeExpiration Number
(default 5 )
|
Minutes before the expiration of a token when automatic renewal will take place |
options.onAutoRenew onAutoRenew?
|
Callback called when auto-renew takes place |
Halts the automatic renewal of a token
void
:
Logs in and maintains the authentication state for the lifetime of this instance.
This can be used to log in by token (JWT), API key, or username and password.
(Object)
Options for logging in
Name | Description |
---|---|
options.token string?
|
Token (JWT) to use directly in authentication |
options.apiKey string?
|
API key to use for authentication |
options.username string?
|
Username to use for authentication |
options.password string?
|
Password to use for authentication |
Promise
:
If successful, result of authenticateToken. Otherwise, an ErrorResponse
Token authentication/renewal
const api = new Track();
api.logIn({ token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' });
API key authentication
const api = new Track();
api.logIn({ apiKey: '00000000-0000-0000-0000-000000000000' });
Username and password authentication
const api = new Track();
api.logIn({ username: 'csingh@example.com', password: 'securepassword' });
Gets a context for querying this customer's external APIs
ExternalApisContext
:
Context for querying this customer's external APIs
Gets an external API resource by id
(Number)
Identity of the external API
ExternalApi
:
ExternalApi resource
Gets a context for querying system-wide roles
RolesContext
:
Context for querying system-wide roles
Base "Resource" context type for all other resources
(any)
Customer resource
This acts as the context for accessing all customer-specific data.
Extends Resource
(any)
(any)
(any)
Creates a new resource
(Client)
Instance of pre-configured client
(RealTimeClient)
Instance of pre-configured realtime client
(string)
Customer code
Customer code
Gets a context for receiving realtime updates for this customer's data.
RealTimeContext
:
Context for receiving realtime updates for this customer's data.
Gets a context for querying this customer's areas
AreasContext
:
Context for querying this customer's areas
Gets a context for querying this customer's assets
AssetsContext
:
Context for querying this customer's assets
Gets an assignable route resource by id
(Number)
Identity of the assignable route
AssignableRoute
:
Assignable route resource
Gets a context for querying this customer's assignable routes
AssignableRoutesContext
:
Context for querying this customer's assignable routes
Gets an assignable stop resource by id
(Number)
Identity of the assignable stop
AssignableStop
:
Assignable stop resource
Gets a context for querying this customer's assignable stops
AssignableStopsContext
:
Context for querying this customer's assignable stops
Gets a assignment resource by vehicle id
(Number)
Identity of the vehicle
Assignment
:
Assignment resource
Gets a voip call record resource by id
(Number)
Identity of the voip call record
VoipCallRecord
:
Voip call record resource
Gets a context for querying this customer's voip call records
VoipCallRecordsContext
:
Context for querying this customer's voip call records
Gets a callParticipant resource by id
(Number)
ID of the call
(Object)
Identify of an existing or object representing a new call participant.
CallParticipant
:
Call participant resource
Gets a context for querying this customer's dispatch messages
DispatchMessagesContext
:
Context for querying this customer's dispatch messages
Gets a dispatch message resource by id
(Number)
Identity of the dispatch message
DispatchMessage
:
Dispatch Message resource
Gets a dispatch message status resource
DispatchMessageStatus
:
Dispatch Message Status resource
Gets a context for querying this customer's drivers
DriversContext
:
Context for querying this customer's drivers
Gets an enplug screenshot by id
(String)
Serial of the Enplug device
EnplugScreenshot
:
EnplugScreenshot resource
Gets an enplug configuration for customer with fields
(Object?)
Values for this enplug configuration.
EnplugConfiguration
:
EnplugConfiguration resource
Gets a context for querying this customer's external APIs
ExternalApisContext
:
Context for querying this customer's external APIs
Gets an external API resource by id
(Number)
Identity of the external API
ExternalApi
:
ExternalApi resource
Gets a customers available message channels by its code.
MessageChannels
:
for fetching this customer's message channels
Gets a context for querying this customer's messages
MessagesContext
:
Context for querying this customer's messages
Gets a Rider App Configuration resource
(Object
= {}
)
New properties with which to initialize the Rider App Configuration
RiderAppConfiguration
:
RiderAppConfiguration resource
Gets a reporting ticket resource
ReportingTicket
:
ReportingTicket resource
Gets a context for querying this customer's routes
RoutesContext
:
Context for querying this customer's routes
Gets a context for querying this customer's patterns
PatternsContext
:
Context for querying this customer's patterns
Gets a context for querying this customer's service packages
ServicePackagesContext
:
Context for querying this customer's service packages
Gets a Service Package resource by ID
(Number)
Identity of the service package
ServicePackage
:
ServicePackage resource
Gets a context for querying this customer's signs
SignsContext
:
Context for querying this customer's signs
Gets a context for querying this customer's stops
StopsContext
:
Context for querying this customer's stops
Gets a context for querying this customer's tags
TagContext
:
Context for querying this customer's tags
Gets a trip cancelation batch resource
TripCancelationBatch
:
Trip Cancelation Batch resource
Gets a TwitterOAuth resource
TwitterOAuth
:
TwitterOAuth resource
Gets a TwitterOAuthRequest resource
TwitterOAuthRequest
:
TwitterOAuthRequest resource
Gets a TwitterUsername resource
TwitterUsername
:
TwitterUsername resource
Gets a context for querying users that have access to this customer. Note that returned users might also have access to other customers, and other users that do not have access to this customer might not be returned.
UserContext
:
Context for querying this customer's users
Gets a context for querying this customer's vehicles
VehiclesContext
:
Context for querying this customer's vehicles
Gets a voip ticket resource
VoipTicket
:
VoipTicket resource
A factory for creating entity-specific Real Time Contexts for a given Real Time Client. An implementation detail for providing .realTime() to the Customer resource without creating circular module imports.
(any)
(any)
Creates a new RealTimeContextFactory that can be used to create entity-specific RealTimeContexts.
(RealTimeClient)
A pre-configured instance of RealTimeClient.
(string)
The customer code for this real-time context.
Creates a RealTimeContext for querying Area updates.
AreasRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Assignment updates.
AssignmentsRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Bike Rack Slot updates.
BikeRackSlotsRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Trip Cancelation updates.
TripCancelationsRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Call State updates.
CallStatesRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Dispatch Messages updates.
DispatchMessagesRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Dispatch Message Status updates.
DispatchMessageStatusRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Enplug Details updates.
EnplugDetailsRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Enplug Healths updates.
EnplugHealthsRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Incident updates.
IncidentsRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Signs updates.
SignsRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Stop Arrivals updates.
StopArrivalsRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Stop updates.
StopsRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Stop Time updates.
StopTimesRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Vehicle Arrivals updates.
VehicleArrivalsRealTimeContext
:
The newly created context.
Creates a RealTimeContext for querying Vehicle updates.
VehiclesRealTimeContext
:
The newly created context.
Creates a VoipHeartbeatHandler for sending current VOIP call state and receiving desired VOIP call state over heartbeats.
(Object)
Options for the handler
VoipHeartbeatHandler
:
The newly created handler.
A real time context that can be used to generate subscriptions to Area entities.
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to Area updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient.
(string)
The customer code to query for updates.
Restrict subscriptions created by this context to a single area.
AreasRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of areas.
AreasRealTimeContext
:
Context with filter applied.
Base "RealTimeContext" type for all other real time contexts.
(any)
(any)
(any)
Creates a real time context that can be used to generate subscriptions.
(RealTimeClient)
Pre-configured instance of RealTimeClient.
(string)
The entity name that Track Real Time API expects for subscriptions
(string)
The customer code to query for updates.
to the resource
Creates a subscription for this real-time context.
(string)
The event name on which the newly-created subscription should fire. May
be either "update" or "delete".
(function)
The handler function to be fired when updates are received for the
newly-created subscription.
Promise
:
A promise that resolves when the subscription has started. The
value of the resolved promise is a function that, when called, will end the subscription.
A real time context that can be used to generate subscriptions to Assignment entities.
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to Assignment updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient.
(string)
The customer code to query for updates.
Restrict subscriptions created by this context to a single vehicle.
AssignmentsRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of vehicles.
AssignmentsRealTimeContext
:
Context with filter applied.
A real time context that can be used to generate subscriptions to Bike Rack Slot entities.
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to Bike Rack Slot updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient.
(string)
The customer code to query for updates.
Restrict subscriptions created by this context to a single vehicle.
BikeRackSlotsRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of vehicles.
BikeRackSlotsRealTimeContext
:
Context with filter applied.
A real time context that can be used to generate subscriptions to Call State entities.
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to Call State updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient.
(string)
The customer code to query for updates.
Restrict subscriptions created by this context to a single vehicle. Vehicle restrictions are independent of user subscriptions.
CallStatesRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of vehicles. Vehicle restrictions are independent of user subscriptions.
CallStatesRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a single user. User restrictions are independent of vehicle subscriptions.
CallStatesRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of users. User restrictions are independent of vehicle subscriptions.
CallStatesRealTimeContext
:
Context with filter applied.
A real-time context that can be used to generate subscriptions to Dispatch Messages
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to DispatchMessage updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient
(string)
Alpha-numeric code of the customer
Restrict subscriptions created by this context to a single driver. Overwrites any existing driver filter for this context. Cannot be called after subscription is started.
DispatchMessagesRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of drivers. Overwrites any existing driver filter for this context. Cannot be called after subscription is started.
DispatchMessagesRealTimeContext
:
Context with filter applied.
A real time context that can be used to generate subscriptions to Dispatch Message Status entities.
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to Dispatch Message Status updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient.
(string)
The customer code to query for updates.
Restrict subscriptions created by this context to a single user. Overwrites any existing user filter for this context. Cannot be called after subscription is started.
DispatchMessagesRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of users. Overwrites any existing user filter for this context. Cannot be called after subscription is started.
DispatchMessagesRealTimeContext
:
Context with filter applied.
A real-time context that can be used to generate subscriptions to Signs
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to Signs updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient
(string)
Alpha-numeric code of the customer
Restrict subscriptions created by this context to a single sign. Overwrites any existing sign filter for this context. Cannot be called after subscription is started.
SignsRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of signs. Overwrites any existing sign filter for this context. Cannot be called after subscription is started.
SignsRealTimeContext
:
Context with filter applied.
A real time context that can be used to generate subscriptions to Stop entities.
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to Stop updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient.
(string)
The customer code to query for updates.
Restrict subscriptions created by this context to a single stop.
StopsRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of stops.
StopsRealTimeContext
:
Context with filter applied.
A real-time context that can be used to generate subscriptions to arrivals for stops
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to StopArrival updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient
(string)
Alphanumeric code of the customer
Restrict subscriptions created by this context to a single stop. Overwrites any existing stop filter for this context. Cannot be called after subscription is started.
StopArrivalsRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of Stops. Overwrites any existing stop filter for this context. Cannot be called after subscription is started.
StopArrivalsRealTimeContext
:
Context with filter applied.
A real time context that can be used to generate subscriptions to Stop Time entities.
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to Stop Time updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient.
(string)
The customer code to query for updates.
Restrict subscriptions created by this context to a single stop.
StopTimesRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of stops.
StopTimesRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a single trip.
StopTimesRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of trips.
StopTimesRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a single vehicle.
StopTimesRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of vehicles.
StopTimesRealTimeContext
:
Context with filter applied.
A real-time context that can be used to generate subscriptions to arrivals for vehicles
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to VehicleArrival updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient
(string)
Alphanumeric code of the customer
Restrict subscriptions created by this context to a single vehicle. Overwrites any existing vehicle filter for this context. Cannot be called after subscription is started.
VehicleArrivalsRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of Vehicles. Overwrites any existing vehicle filter for this context. Cannot be called after subscription is started.
VehicleArrivalsRealTimeContext
:
Context with filter applied.
A real-time context that can be used to generate subscriptions to enplug details for vehicles
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to EnplugDetails updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient
(string)
Alphanumeric code of the customer
Restrict subscriptions created by this context to a single vehicle. Overwrites any existing vehicle filter for this context. Cannot be called after subscription is started.
EnplugDetailsRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of Vehicles. Overwrites any existing vehicle filter for this context. Cannot be called after subscription is started.
EnplugDetailsRealTimeContext
:
Context with filter applied.
A real-time context that can be used to generate subscriptions to enplug healths for vehicles
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to EnplugHealths updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient
(string)
Alphanumeric code of the customer
Restrict subscriptions created by this context to a single vehicle. Overwrites any existing vehicle filter for this context. Cannot be called after subscription is started.
EnplugHealthsRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of Vehicles. Overwrites any existing vehicle filter for this context. Cannot be called after subscription is started.
EnplugHealthsRealTimeContext
:
Context with filter applied.
A real time context that can be used to generate subscriptions to Incident entities.
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to Incident updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient.
(string)
The customer code to query for updates.
Restrict subscriptions created by this context to a single vehicle. Vehicle restrictions are independent of user subscriptions.
IncidentsRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of vehicles. Vehicle restrictions are independent of user subscriptions.
IncidentsRealTimeContext
:
Context with filter applied.
A real time context that can be used to generate subscriptions to Vehicle entities.
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to Vehicle updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient.
(string)
The customer code to query for updates.
Restrict subscriptions created by this context to a single vehicle.
VehiclesRealTimeContext
:
Context with filter applied.
Restrict subscriptions created by this context to a set of vehicles.
VehiclesRealTimeContext
:
Context with filter applied.
Handler for VOIP call state and receiving desired VOIP call state over heartbeats.
(any)
(any)
(any
= {}
)
Creates a VoipHeartbeatHandler for sending current VOIP call state and receiving desired VOIP call state over heartbeats.
(RealTimeClient)
A pre-configured instance of RealTimeClient.
(string)
The customer code for this real-time context.
(Object
= {}
)
Options for the handler
Name | Description |
---|---|
options.heartbeatIntervalMs number?
|
The minimum interval to send heartbeats to Track API |
options.heartbeatReadTimeoutMs number?
|
The time to wait for receiving a heartbeat from Track API |
options.participantType string?
|
Indication of the type of participant that is reporting a heartbeat. Valid values are "User" (default) and "Supervisor" |
Registers a handler function to be called when the call state changes. Handler will be called with the desired call state, call href, and whether the connection should be muted.
(function)
function(callState, callHref, isMuted)
VoipHeartbeatHandler
:
This VoipHeartbeatHandler
Set a handler to be run after detecting a disconnect from the server. Overwrites any previously set handler, if any.
(function)
The function to run
VoipHeartbeatHandler
:
returns itself.
Set a handler to be run after successfully reconnecting to the server. Overwrites any previously set handler, if any.
(function)
The function to run
VoipHeartbeatHandler
:
returns itself.
Start sending VoIP heartbeat messages to the Track API server.
VoipHeartbeatHandler
:
returns itself.
Stop sending VoIP heartbeat messages to the Track API server.
VoipHeartbeatHandler
:
returns itself.
A real time context that can be used to generate subscriptions to TripCancelation entities.
Extends RealTimeContext
(any)
(any)
Creates a context that can subscribe to TripCancelation updates.
(RealTimeClient)
Pre-configured instance of RealTimeClient.
(string)
The customer code to query for updates.
Restrict subscriptions created by this context to a single customer.
TripCancelationsRealTimeContext
:
Context with filter applied.
Agency resource
Extends Resource
(any)
(...any)
Creates a new Agency object
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial agency data to a new instance
const client = new Client();
const partialAgencyData = {
href: '/1/SYNC',
name: 'Syncromatics',
};
const agency = new Agency(client, partialAgencyData);
agency.hydrated == true;
Area resource
Extends Resource
(any)
(...any)
Creates a new area.
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial area data to a new instance
const client = new Client();
const partialAreaData = {
href: '/1/SYNC/areas/1',
id: 1,
name: 'South Yard',
encoded_polygon: 'crneFnwljVa...',
area_type: 'Yard',
};
const area = new Area(client, partialAreaData);
area.hydrated === true;
Area querying context
This is used to query the list of areas for a customer
Extends PagedContext
(any)
(any)
(any)
Asset resource
Extends Resource
(any)
(...any)
Asset querying context
This is used to query the list of assets for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the desired asset type for this context. This is required.
(string)
Type of asset to return. Supported types are 'Logo' and 'GenericImageMedia'
AssetsContext
:
Returns itself
const assets = new AssetsContext(...);
assets
.withAssetType('logo')
.getPage()
.then(page => ...)
AssignableRoute resource
Extends Resource
(any)
(...any)
AssignableRoutes querying context
This is used to query the list of Assignable Routes for a customer
Extends PagedContext
(any)
(any)
(any)
AssignableStop resource
Extends Resource
(any)
(...any)
AssignableStop querying context
This is used to query the list of Assignable Stops for a customer
Extends PagedContext
(any)
(any)
(any)
Vehicle assignment resource
Extends Resource
(any)
(...any)
Block resource
Extends Resource
(any)
(...any)
Creates a new Block resource object
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial block data to a new instance
const client = new Client();
const partialBlockData = {
href: '/1/SYNC/blocks/1',
name: 'Scheduled Block',
short_name: 'B01',
};
const block = new Block(client, partialBlockData);
block.hydrated == true;
User querying context
This is used to query the list of users for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
CustomerUsersContext
:
Returns itself
const users = new CustomerUsersContext(...);
users
.withQuery('Charlie')
.getPage()
.then(page => ...);
Call resource
Extends Resource
(any)
(any)
CallParticipant resource
Extends Resource
(any)
(any)
DispatchMessage resource
Extends Resource
(any)
(any)
Creates a new dispatch message
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial DispatchMessage data to a new instance
const client = new Client();
const partialDispatchMessageData = {
href: '/1/SYNC/dispatch_messages/1',
message: 'Radio chatter...',
};
const dispatchMessage = new DispatchMessage(client, partialDispatchMessageData);
dispatchMessage.hydrated == true;
Dispatch Message querying context
This is used to query the list of dispatch messages for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the query term for the context
(string)
Query term to search for in dispatch message text
DispatchMessagesContext
:
Returns itself
const dispatchMessages = new DispatchMessagesContext(...);
dispatchMessages
.withQuery('radio chatter')
.getPage()
.then(page => ...);
Sets the driver for whom to retrieve dispatch messages
(number)
Id of the driver
DispatchMessagesContext
:
Returns itself
const dispatchMessages = new DispatchMessagesContext(...);
dispatchMessages
.forDriver(1)
.getPage()
.then(page => ...);
Sets the vehicle for which to retrieve dispatch messages
(number)
Id of the vehicle
DispatchMessagesContext
:
Returns itself
const dispatchMessages = new DispatchMessagesContext(...);
dispatchMessages
.forVehicle(1)
.getPage()
.then(page => ...);
Sets the start date to search for dispatch messages
(string)
Parsable string representing the date
DispatchMessagesContext
:
Returns itself
const dispatchMessages = new DispatchMessagesContext(...);
dispatchMessages
.sinceDate('2018-01-31')
.getPage()
.then(page => ...);
Sets the end date to search for dispatch messages
(string)
Parsable string representing the date
DispatchMessagesContext
:
Returns itself
const dispatchMessages = new DispatchMessagesContext(...);
dispatchMessages
.endDate('2020-01-31')
.getPage()
.then(page => ...);
Creates a new dispatch message batch
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial dispatchMessageBatch data to a new instance
const client = new Client();
const partialData = {
href: '/1/SYNC/dispatch_messages/batches/90892e24-5279-4066-b109-a112925edb89',
dispatch_messages: [
{ href: '/1/SYNC/dispatch_messages/1' },
{ href: '/1/SYNC/dispatch_messages/2' }
]
};
const dispatchMessageBatch = new DispatchMessageBatch(client, partialData);
dispatchMessageBatch.hydrated == true
Fetches the data for this dispatch message batch via the client
Promise
:
If successful, a hydrated instance of this dispatch message batch
Creates a new dispatch message batch via the client
Promise
:
If successful, a hydrated instance of this dispatch message batch with id
Makes a href for a given customer code and ID
(string)
Alphanumeric code of the customer
(string)
ID of the dispatch message batch
object
:
href object containing URL for the instance
Driver resource
Extends Resource
(any)
(any)
Creates a new driver.
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial driver data to a new instance
const client = new Client();
const partialDriverData = {
href: '/1/SYNC/drivers/1',
id: 1,
customer_driver_id: '0001',
first_name: 'Charlie',
last_name: 'Singh',
};
const driver = new Driver(client, partialDriverData);
driver.hydrated == true;
Driver querying context
This is used to query the list of drivers for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
DriversContext
:
Returns itself
const drivers = new DriversContext(...);
drivers
.withQuery('blue')
.getPage()
.then(page => ...);
Incident resource
Extends Resource
(any)
(any)
EnplugScreenshot resource
Extends Resource
(any)
(...any)
Creates a new enplugScreenshot
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial enplug screenshot data to a new instance
const client = new Client();
const partialEnplugScreenshot = {
href: '/1/SYNC/enplugs/LLM3/screenshot',
contentType: 'image/jpeg',
name: '1',
};
const enplugScreenshot = new EnplugScreenshot(client, partialEnplugScreenshot);
enplugScreenshot.hydrated == true;
EnplugConfiguration resource
Extends Resource
(any)
(...any)
Creates a new enplugConfiguration
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial enplug configuration data to a new instance
const client = new Client();
const partialEnplugConfiguration = {
href: '/1/SYNC/enplugs/LLM3/configuration',
volume: 27,
vehicleHref: '/1/SYNC/vehicles/1234',
};
const enplugConfiguration = new EnplugConfiguration(client, partialEnplugConfiguration);
enplugConfiguration.hydrated == true;
Message resource
Extends Resource
(any)
(any)
Creates a new message
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial message data to a new instance
const client = new Client();
const partialMessageData = {
href: '/1/SYNC/messages/1',
name: '5k Detour',
text: 'Due to the 5k Race...',
};
const message = new Message(client, partialMessageData);
message.hydrated == true;
Sign message resource
Extends Resource
(any)
(...any)
Message querying context
This is used to query the list of messages for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
MessagesContext
:
Returns itself
const messages = new MessagesContext(...);
messages
.withQuery('12')
.getPage()
.then(page => ...);
MessageChannels resource
Extends Resource
(any)
(...any)
Creates a new MessageChannels.
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial message channels data to a new instance
const client = new Client();
const partialMessageChannelsData = [{
href: '/1/SYNC/message_channel/GTFS-RT',
name: 'GTFS-RT',
}];
const messageChannel = new MessageChannel(client, partialMessageChannelsData);
messageChannel.hydrated === true;
Dispatch Message Status resource
Extends Resource
(any)
(any)
Route resource
Extends Resource
(any)
(...any)
Creates a new pattern
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial route data to a new instance
const client = new Client();
const partialPatternData = {
href: '/1/SYNC/patterns/2',
name: '9876',
};
const pattern = new Pattern(client, partialPatternData);
pattern.hydrated == true;
Route querying context
This is used to query the list of patterns for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
PatternsContext
:
Returns itself
const patterns = new PatternsContext(...);
patterns
.withQuery('blue')
.getPage()
.then(page => ...);
Appends an expanded property for the context
(string)
Property to expand the model for
PatternsContext
:
Returns itself
const patterns = new PatternsContext(...);
patterns
.withExpandedProperty('stops')
.getPage()
.then(page => ...);
Restricts this context to only patterns that are enabled or disabled for operations
(bool
= true
)
Whether to return only enabled or disabled patterns
PatternsContext
:
Returns itself
const patterns = new PatternsContext(...);
patterns
.withEnabledForOperations()
.getPage()
.then(page => ...);
Restricts this context to only patterns that are assigned to an active service as of asOf. If the customer signs their vehicles in to trips or to runs, this criteria is ignored.
(Date)
The date to search
PatternsContext
:
Returns itself
const patterns = new PatternsContext(...);
const now = new Date();
patterns
.withAsOf(now)
.getPage()
.then(page => ...);
ReportingTicket resource
Extends Resource
(any)
(...any)
Rider App Configuration resource
Extends Resource
(any)
(...any)
Route resource
Extends Resource
(any)
(...any)
Creates a new route
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial route data to a new instance
const client = new Client();
const partialRouteData = {
href: '/1/SYNC/routes/2',
name: '9876',
};
const route = new Route(client, partialRouteData);
route.hydrated == true;
Route querying context
This is used to query the list of routes for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
RoutesContext
:
Returns itself
const routes = new RoutesContext(...);
routes
.withQuery('blue')
.getPage()
.then(page => ...);
Run resource
Extends Resource
(any)
(...any)
Creates a new Run resource object
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial run data to a new instance
const client = new Client();
const partialRunData = {
href: '/1/SYNC/runs/1',
name: 'Scheduled Run',
short_name: 'R01',
};
const run = new Run(client, partialRunData);
run.hydrated == true;
Service resource
Extends Resource
(any)
(...any)
Creates a new Service resource object
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial Service data to a new instance
const client = new Client();
const partialServiceData = {
href: '/1/SYNC/services/1',
id: 1,
start: new Date(2017-01-01T00:00:00.000-0700),
end: '2017-01-01T00:00:00.000-0700'
};
const service = new Service(client, partialServiceData);
service.hydrated === true;
Service package resource
Extends Resource
(any)
(...any)
Creates a new ServicePackage
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial ServicePackage data to a new instance
const client = new Client();
const partialData = {
href: '/1/SYNC/service_packages/1',
name: 'First Package',
};
const servicePackage = new ServicePackage(client, partialData);
servicePackage.hydrated === true;
ServicePackage querying context
This is used to query the list of service packages for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
ServicePackagesContext
:
Returns itself
const servicePackages = new ServicePackagesContext(...);
servicePackages
.withQuery('blue')
.getPage()
.then(page => ...);
Sets the "as of" date to retrieve service packages as of this date
ServicePackagesContext
:
Returns itself
Settings resource
Extends Resource
(any)
(...any)
Creates a new customer settings resource
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial settings data to a new instance
const client = new Client();
const partialSettingsData = {
href: '/1/SYNC/settings',
sign_in_type: 'trip',
};
const settings = new Settings(client, partialSettingsData);
settings.hydrated == true;
Sign resource
Extends Resource
(any)
(...any)
Creates a new sign
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial sign data to a new instance
const client = new Client();
const partialSignData = {
href: '/1/SYNC/signs/2',
name: 'The second sign',
};
const sign = new Sign(client, partialSignData);
sign.hydrated == true;
Sign querying context
This is used to query the list of signs for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
SignsContext
:
Returns itself
const signs = new SignsContext(...);
signs
.withQuery('12')
.getPage()
.then(page => ...);
Stop resource
Extends Resource
(any)
(...any)
Creates a new stop
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial stop data to a new instance
const client = new Client();
const partialStopData = {
href: '/1/SYNC/stops/2',
name: '9876',
};
const stop = new Stop(client, partialStopData);
stop.hydrated == true;
Stop querying context
This is used to query the list of stops for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
StopsContext
:
Returns itself
const stops = new StopsContext(...);
stops
.withQuery('12')
.getPage()
.then(page => ...);
Tag resource
Extends Resource
(any)
(any)
Tag querying context
This is used to query the list of tags for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
TagsContext
:
Returns itself
const tags = new TagContext(...);
tags
.withQuery('LA')
.getPage()
.then(page => ...);
Trip resource
Extends Resource
(any)
(...any)
Creates a new trip.
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial trip data to a new instance
const client = new Client();
const partialTripData = {
href: '/1/SYNC/trips/1',
id: 1,
name: 'T01',
order: 1,
};
const trip = new Trip(client, partialTripData);
trip.hydrated == true;
Write-only Twitter OAuth resource
Extends Resource
(any)
(any)
Get-only Twitter OAuth Request resource
Extends Resource
(any)
(any)
Read-only Twitter Username resource.
Extends Resource
(any)
(any)
Vehicle resource
Extends Resource
(any)
(...any)
Creates a new vehicle
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial vehicle data to a new instance
const client = new Client();
const partialVehicleData = {
href: '/1/SYNC/vehicles/2',
name: '9876',
assignment: {
sign_in_type: 'Dispatch',
},
};
const vehicle = new Vehicle(client, partialVehicleData);
vehicle.hydrated == true;
VehicleMedia resource
Extends Resource
(any)
(...any)
Creates a new vehicleMedia
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial vehicle media data to a new instance
const client = new Client();
const partialVehicleMediaData = {
href: '/1/SYNC/vehicle/2/media/1',
contentType: 'image/jpeg',
name: '1',
};
const vehicleMedia = new VehicleMedia(client, partialVehicleMediaData);
vehicleMedia.hydrated == true;
Vehicle querying context
This is used to query the list of vehicles for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
VehiclesContext
:
Returns itself
const vehicles = new VehiclesContext(...);
vehicles
.withQuery('12')
.getPage()
.then(page => ...);
VoipTicket resource
Extends Resource
(any)
(...any)
Voip call record querying context
This is used to query the list of voip call records for a customer
Extends PagedContext
(any)
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
VoipCallRecordsContext
:
Returns itself
const voipCallRecords = new VoipCallRecordsContext(...);
voip call records
.withQuery('blue')
.getPage()
.then(page => ...);
Sets the start date to search for voip call records
(string)
Parsable string representing the date
DispatchMessagesContext
:
Returns itself
const voipCallRecords = new VoipCallRecordsContext(...);
voipCallRecords
.fromDate('2018-01-31')
.getPage()
.then(page => ...);
Sets the end date to search for voip call records
(string)
Parsable string representing the date
DispatchMessagesContext
:
Returns itself
const voipCallRecords = new VoipCallRecordsContext(...);
voipCallRecords
.toDate('2018-01-31')
.getPage()
.then(page => ...);
VoipCallRecord resource
Extends Resource
(any)
(any)
Creates a new TripCancelationBatch object for fetching/saving trip cancelations
Fetches current trip cancelation data for customer
Promise
:
If successful, a hydrated instance of this trip cancelation batch
Create new cancelations for customer
Promise
:
If successful, a hydrated instance of this trip cancelation batch
Makes a href for a given customer code
(string)
Alphanumeric code of the customer
object
:
href object containing URL for the instance
TripCancelation resource
Extends Resource
(any)
(...any)
External API resource
Extends Resource
(any)
(...any)
ExternalApi querying context
This is used to query the list of external APIs for a customer
Extends PagedContext
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
ExternalApisContext
:
Returns itself
const externalApis = new ExternalApisContext(...);
externalApis
.withQuery('arrivals')
.getPage()
.then(page => ...);
Generic paged query context
(any)
(any
= {}
)
Creates a new paged context
(Client)
Instance of pre-configured client
(Object?
= {}
)
Object of querystring parameters to append to the URL
Name | Description |
---|---|
params.page Number
(default 1 )
|
Number of the page to request |
params.per_page Number
(default 10 )
|
Number of items per page to request |
params.sortFields Array<Object>?
|
Array of sort fields to sort the results by |
params.sortFields string
|
[].field String representing the field to sort by. Fields are specified in dotted property notation. |
params.sortFields string
|
[].direction Direction by which to sort results. Valid values are 'asc' and 'desc'. |
Sets the page to request for the context
(Number)
Page number to request. (First page is 1)
PagedContext
:
Returns itself
const context = new PagedContext(...);
context
.withPage(3)
.getPage()
.then(page => ...);
Sets the maximum number of items per page to request for the context
(Number)
Number of items per page
PagedContext
:
Returns itself
const context = new PagedContext(...);
context
.withPerPage(20)
.getPage()
.then(page => ...);
Sets the requested sort order of the response, clearing any prior sort order
(string)
String representing the field to sort by.
Fields are specified in dotted property notation.
(string
= asc
)
Direction by which to sort results.
Valid values are 'asc' and 'desc'.
PagedContext
:
Returns itself
const context = new PagedContext(...);
context
.sortBy('assignment.start', 'desc')
.thenBy('name')
.getPage()
.then(page => ...);
Adds to the requested sort order
(string)
String representing the field to sort by.
Fields are specified in dotted property notation.
(string
= asc
)
Direction by which to sort results.
Valid values are 'asc' and 'desc'.
PagedContext
:
Returns itself
const context = new PagedContext(...);
context
.sortBy('assignment.start', 'desc')
.thenBy('name')
.getPage()
.then(page => ...);
Represents a page of results
(any)
(any)
(any)
(any)
List of results in the current page
Links to other pages relative to the current page
Instance of pre-configured client
Function to map each result in the page to a new object
URI of the page of results to request
Object of querystring parameters to append to the URL
Role resource
Extends Resource
(any)
(...any)
Role querying context
This is used to query the list of Roles for a Customer
Extends PagedContext
(any)
(any)
Sets the query term for the context
(string)
Query term to search for
RolesContext
:
returns itself
User resource
Extends Resource
(any)
(...any)
Creates a new user
Will populate itself with the values given to it after the client parameter
(Client)
Instance of pre-configured client
(Array)
Remaining arguments to use in assigning values to this instance
Assigning partial user data to a new instance
const client = new Client();
const partialUserData = {
href: '/1/users/1',
id: 1,
};
const user = new User(client, partialUserData);
user.hydrated == true;
Collection of functions to make HTTP requests to the Track API
(any
= {}
)
Sets the current JSON Web Token
(JWT)
New token to use as current
void
:
Makes an HTTP request
(string)
HTTP method to use (GET, POST, etc.)
(string)
URI to make request to after resolving
Promise
:
Promise of a
Response
if successful, or of
ErrorResponse
if unsuccessful
Clears the internal authentication state of the client
void
:
A client that can be used for creating, maintaining, and monitoring WebSocket connections to the Track Real Time API.
(any)
(any
= {}
)
Creates a new realtime client
(Client)
Instance of pre-configured REST client
(Object
= {}
)
Options for using the client to connect to the Track API
Name | Description |
---|---|
options.reconnectOnClose boolean?
|
Whether to re-establish a connection when the current connection is closed. Defaults to true. |
options.reconnectTimeout number?
|
Number of milliseconds to wait before reattempting a connection |
options.realTimeUri string?
|
The URI for the WebSocket connection to the RealTime API. Defaults to production. |
Adds an event listener to be called whenever the client disconnects unexpectedly or subsequently reconnects.
(string)
The event name on which the listener should fire. Must be either
'disconnect' or 'reconnect'.
(function)
The listener function to be fired as appropriate.
void
:
Removes a previously added event listener for unexpected disconnects or reconnects, using strict equality comparisons.
(string)
The event name from which the listener should be remove. Must be either
'disconnect' or 'reconnect'.
(function)
The listener function to be removed.
void
:
Closes the open realtime connection (if applicable) while temporarily superceding the reconnect
void
:
Event handler fired when the WebSocket connection is closed. Re-establishes the connection, if configured to do so.
void
:
Event handler fired when the WebSocket connection is opened. Sends authentication headers and any messages queued before the connection was established.
void
:
Event handler fired when a message is received on the WebSocket connection. Handles Authentication messages. Otherwise, parses the message and delegates to the appropriate handler.
(MessageReceivedEvent)
The event received from the WebSocket.
void
:
Creates a subscription to the Track Real Time API.
(string)
The name of the subscribed entity
(string)
The Customer for whose data the subscription will be created.
(Object)
Filters to be passed for the created subscription.
(function)
The function to fire when updates are received for this
subscription.
Promise
:
A promise that resolves when the subscription request has been sent. The
value of the resolved promise is a function that will end the subscription.
Ends a subscription to the Track Real Time API.
(object)
Object containing the current subscription ID
Name | Description |
---|---|
subscriptionContainer.subscriptionId String
|
Identity of the current subscription |
(Promise)
Promise that will be resolved upon end of the subscription
void
:
Creates a Track Real Time API control message for authenticating a connection.
(string)
A pre-authenticated JSON Web Token for authorizing this connection.
Object
:
The created authentication request message.
Creates a Track Real Time API control message for creating a subscription.
(string)
The entity for which the subscription should be created.
(any)
Customer Code for which the subscription should be created.
Object
:
The created subscription request message.
Generic error response from the client
(any)
Error response for "404 Not Found"
Extends ErrorResponse
Error response for "403 Forbidden"
Extends ErrorResponse
(any)
(any)
Error response for any HTTP 500 series error
Extends ErrorResponse
(any)
(any)
Maps a Response according to its status
Promise
:
If successful, returns response. Otherwise, returns an ErrorResponse.