Events

This document describes the different events that may show up on the eventqueue. Only the most used events are documented.

Common fields for all events

These fields are included in all events.

  • eventId:(string) A unique ID generated from the global backend. This can be used to guard against receiving the same event multiple times, if the reading process can not handle that in other ways.
  • eventName:(string) This is the name of the event. It will be the specific class name of the instance.
  • timestamp:(long) This is a long value, with milliseconds since epoch.
  • isoTimestamp:(string) This is the timestamp formatted into an easier readable format according to ISO8601.
  • consistencyLevel:(May have the values NONE or IMPORTANT) This indicates the level of effort in delivery of the event.

com.comoyo.events.user.UserAnnounce

This event will be raised when a new phone or email appears in the global backend. This will happen when a new user is created, or when a user adds additional phones and mails to their user profile. A single event will contain either phone or mail information.

UserAnnounce is typically routed to event queues based on phone number prefix. This has to be configured on a per queue basis.

Additional parameters:

  • userId:(string) The user ID of the end-user.
  • msisdn:(string) The complete MSISDN that was added.
  • email:(string) The complete email address that was added.

Example:

{
  "timestamp": 1457108572215,
  "eventId": "6111556312875671552",
  "msisdn": "xxx23326323",
  "userId": "6111556311420xxxxxx",
  "consistencyLevel": "NONE",
  "eventName": "com.comoyo.events.user.UserAnnounce",
  "isoTimestamp": "2016-03-04T16:22:52.215Z"
}

User events

There are several events related to users. The common fields for all User events are listed here. The following sections describe each specific event.

Additional parameters:

  • userId:(string) The user ID of the end-user.
  • buId:(string) The recipient of the event; if you are reading this event, that is you.

com.comoyo.events.user.ServiceAnnounce

The user has started his relationship with a new service. This is typically emitted when a user gets a right to a service, or logs in for the first time.

Additional parameter:

  • serviceName: The name of the service. This is the same name you can find in the service info API on each individual user.

Example:

{
  "timestamp": 1457095701006,
  "eventId": "6111502327112278016",
  "buId": "NNN",
  "userId": "6111502313552xxxxxx",
  "consistencyLevel": "NONE",
  "eventName": "com.comoyo.events.user.ServiceAnnounce",
  "serviceName": "capture",
  "isoTimestamp": "2016-03-04T12:48:21.006Z"
}

The following events, including right events and subscription events, are only enabled by request for specific Business Units, and may not be relevant to the reader.

User events require hardlinking, with additional parameter(s) noted:

  • com.comoyo.events.user.UserActivated : Event raised when user changes state from inactive to active.
  • com.comoyo.events.user.UserBirthdateUpdated : Event raised when user's birthdate is updated.
    • birthDate:(string) The updated birth date of the user.
  • com.comoyo.events.user.UserBuAssigned : Event raised when user has been assigned a Business Unit (BU).
  • com.comoyo.events.user.UserCreated : Event raised when user is created.
  • com.comoyo.events.user.UserDeleted : Event raised when user is terminated/deleted.
  • com.comoyo.events.user.UserMailUpdated : Event raised when email address is created or updated on user.
    • emailAddress:(string) The updated e-mail address of the user.
  • com.comoyo.events.user.UserMailVerified : Event raised when user mail verification link is visited.
  • com.comoyo.events.user.UserMobileUpdated : Event raised when user's mobile number is updated.
    • mobileNumber:(string) The updated mobile number of the user.
  • com.comoyo.events.user.UserNameUpdated : Event raised when user's name is updated.
    • newName:(string) The updated name of the user.
  • com.comoyo.events.user.UserPasswordUpdated : Event raised when password is updated or created on user.
  • com.comoyo.events.user.UserPhoneDeleted: Event emitted when a phone has been deleted from a user. The event includes buId for routing, and is not intended for msisdn prefix routing.

com.comoyo.events.report.ReportCreated

This event is emitted whenever the Analytics Report Engine runs a specific report. It can be used as a trigger to fetch reports.

Additional parameters:

  • reportName:(string) The name property of the generated report. This will be one of several different names to distinguish which report has been generated. This allows the client to ignore unwanted reports and only continue fetching the needed ones. The possible names are: connected-users non-connected-region-users service-announce reconciliation
  • grantorId:(string) This is the recipient of the report. If you are reading the event, that is you.
  • url:(string) This is the direct URL to fetch the report. It is protected by basic auth using the normal API credentials.

Example:

{
  "grantorId": "NNN",
  "timestamp": 1457054040507,
  "eventId": "6111327590314672128",
  "consistencyLevel": "IMPORTANT",
  "eventName": "com.comoyo.events.report.ReportCreated",
  "reportName": "service-announce",
  "url": "https://api.staging.telenor.io/analytics/reports/NNN/service-announce/2016/03/03/NNN-service-announce-20160303-20160304T011004Z.json",
  "isoTimestamp": "2016-03-04T01:14:00.507Z"
}

com.comoyo.events.right.RightEvent

Additional parameters:

  • rightId:(string) The right ID. This is an alphanumeric identifier unique for every right.
  • userId:(string) The CONNECT ID for the user owning the right.
  • externalRef:(string) Deprecated in favour of link. Kept for backwards compatibility.
  • sku:(string) Stock-keeping unit. The SKUs are defined in the Service Catalog.
  • grantorId:(string) The grantor ID of the one that created the right.
  • grantorContext:(string) A context string used by the grantor. Unless you are the grantor you should not make assumptions on the content of this field
  • link:(list) A list of links to related resources.
    • self:(string) points to the right itself
    • user:(string) points to the CONNECT user owning the right
    • use:(string) points to the usage endpoint
    • suspend:(string) which is used to suspend the right.

Right events:

  • com.comoyo.events.right.RightActive: Event raised when a right is activated.
  • com.comoyo.events.right.RightDeleted: Event raised when a right is deleted.
  • com.comoyo.events.right.RightExpired: Event raised when a right is expired.
  • com.comoyo.events.right.RightGranted: Event raised when a right has been granted to a user.
  • com.comoyo.events.right.RightSuspended: Event raised when a right is suspended.
  • com.comoyo.events.right.RightUsed: Event raised when a right has been consumed by an user.

com.comoyo.events.subscription.SubscriptionEvent

Additional parameters:

  • subscriptionId:(string) The subscription ID. This is an alphanumeric identifier unique for all subscriptions.
  • skus:(list) Stock-keeping unit. The SKUs are defined in the Service Catalog.
  • userId:(string) The CONNECT ID for the user owning the right.
  • grantorId:(string) The grantor ID of the one that created the right.
  • grantorContext:(string) A context string used by the grantor. Unless you are the grantor you should not make assumptions on the content of this field.

Subscription events:

  • com.comoyo.events.subscription.SubscriptionActive: Event raised when a subscription is activated on an user.
  • com.comoyo.events.subscription.SubscriptionDeleted: Event raised when a subscription is deleted.
  • com.comoyo.events.subscription.SubscriptionExpired: Event raised when a subscription has expired for an user.
  • com.comoyo.events.subscription.SubscriptionGranted: Event raised when a subscription has been granted to an user.
  • com.comoyo.events.subscription.SubscriptionSuspended: Event raised when a subscription has been suspended for an user.