Activity Events

The following activity events can be specified as part of the request for creating a subscription.

Event Description

activityCreated

The event occurs when a new activity is created.

activityUpdated

The event occurs when the activity properties are changed.

Note:

For segmentable activities, custom properties aren't present in the events for pending segments. Update to such properties are present only in the events for the parent activity.

activityStarted

The event occurs when the activity status is changed to started, that is, the resource has begun performing the activity.

activitySuspended

The event occurs when the activity status is changed to pending and a simultaneous new activity with the 'suspended' status is created duplicating the original activity.

activity completed

The event occurs when the activity status is changed to completed, that is, the activity is complete.

activityNotDone

The event occurs when the activity status is changed to notdone, that is, a started activity can't be completed for some reason.

activityCanceled

The event occurs when the activity status is changed to cancelled, that is, the activity has not been started and won't be performed.

activityDeleted

The event occurs when the activity is removed from the system. An activity can be deleted only from an inactive route.

Note:

When an activity is deleted from the system, the activityDeleted event does not return some fields (such as Custom properties and the country_code) regardless of the subscription settings.

activityDelayed

The event occurs when the end time of a started activity is changed to extend the activity duration.

activityReopened

The event occurs after creating a pending activity by duplicating a previously completed, cancelled, or complete activity.

activityPreworkCreated

The event occurs after creating an additional activity that's necessary to perform a pending activity. Preworks are created with the activity status as started.

activityMoved

The event occurs when an activity is reassigned to a different resource or date. The activityDetails section of the event contains original values of the date and resourceId fields and the activityChanges section describes the move (reassign) destination. The moveDetails section contains move action details.

activityTravelStarted

The event occurs when the activity status is changed to enroute, that is, the resource has begun travel to the activity.

activityTravelStopped

The event occurs when the activity status is changed from enroute to any other status, that is, the resource has stopped travel to the activity. For example, the event occurs when the activity status is changed from enroute to pending, started, cancel, and so on.

Event Fields

The activity events contain the following fields:

  • eventType: The type of the event, such as activityCreated, activityUpdated, and so on.
  • applicationId: The ID of the application that performed the operation which generated the event. It is only present if the operation was performed by an Application.
  • time: The time of the event in UTC time standard (string). The time format is YYYY-MM-DD HH:MM:SS.
  • user: The user who performed this event (string).
  • activityDetails: A record containing the following activity-related key fields. The date and time fields are in UTC standard time. Customized set of fields may be requested in the subscription configuration via "fields" parameter. Note that for the activityUpdated and activityMoved events, the number of fields cannot be more than 15 and the values longer than 256 bytes will be truncated.
    • activityId: The identifier of the activity (integer). This is a mandatory field.

      Note:

      For the activityPreworkCreated event, the activityId field contains the identifier of the main activity for which the prework is created.
    • resourceId: The identifier of the resource to which the activity is assigned (string). This is a mandatory field. The field maps to the external_id field .
    • date: The date the activity is scheduled in the format YYYY-MM-DD. If the activity isn't scheduled, the value is NULL.
    • apptNumber: This field is used by integrations to hold the external ID of the activity. The external ID is the identifier of the activity in the origin system. This is a mandatory field.
    • customerNumber: This field is used by integrations to hold the external ID of the account. The external ID is the identifier of the account in the origin system. This is an optional field.
  • activityChanges: The list of activity fields that changed with the event. The fields have the same types and values as used in the GET, POST, and PATCH operations with a few exceptions. The time fields are in UTC standard time.
  • moveDetails: Following are move action fields
    • moveReason: Move Reason Label. The field is returned only if move reason is populated upon manual move
    • moveCondition: Name of move reason condition of the move action. Returned values: 'bucketToResource', 'resourceToResource', 'resourceToBucket', 'bucketToBucket'
    • workSkillMismatch: Status of Work Skill Mismatch violation. Returned values: true, false. When using in filterExpression, possible values are (0, 1)
    • workZoneMismatch: Status of Work Zone Mismatch violation. Returned values: true, false. When using in filterExpression, possible values are (0, 1)