Subscription Event Queries

Subscriber, group, and device event queries query the in-memory event database. You can include optional parameters in the URL to filter the results. For information about querying the event database and the Event Repository, see the discussion about the event REST APIs.

Optional Parameters

Parameter Datatype Description
querySize unsigned int32 querySize (default is 0=system default) determines the number of records returned per call.
queryCursor unsigned int64 If the query results do not fit in a single response, a QueryCursor is included in the response. If the cursor is NULL or 0, the list is complete. If there are additional entries in the list, you can retrieve the subsequent pages of the response by calling this URL again and specifying a queryCursor parameter on the url.
eventTimeLowerBound datetime Specifies the lower bound of the event time range used to filter the query results. Events whose event time is greater than or equal to the lower bound are returned.
eventTimeUpperBound datetime Specifies the upper bound of the event time range used to filter the query results. Events whose event time is less than the upper bound are returned.
eventTypes string Events whose event type prefix matches the specified types are returned. Separate event types with a comma.
The EventTypeArray in the MtxPrimaryEvent MDC defines the event type that was initiated, representing it numerically in the MDC as an array of strings such as "4", "1.2", or "1.3.5". The top-level event types are:
  • ROOT = 0
  • USAGE = 1
  • RECURRING = 2
  • FIRST_USAGE = 3
  • PURCHASE = 4
  • CANCEL = 5
  • BALANCE_ADJUST = 6
  • BALANCE_TOPUP = 7
  • SUSPEND = 9
  • RESUME = 10
  • SESSION_END = 11
  • WRITE_OFF = 12
  • NOTIFICATION_DONE = 13
  • OBJECT_CREATE = 14
  • STATUS_CHANGE = 15
  • USAGE_REFUND = 16
  • OBJECT_DELETE = 18
  • BALANCE_TRANSFER = 19
  • BALANCE_ROLLOVER = 20
  • ROLLOVER_BALANCE_ADJUST = 21
  • SESSION_CONTEXT_END = 22
  • FORFEITURE = 23
  • PAYMENT_AUTHORIZATION = 24
  • PAYMENT_SETTLEMENT = 25
  • AUTO_RENEW = 26
  • PAYMENT = 27
  • POLICY_SESSION_START = 28
  • POLICY_CHANGE = 29
  • RECHARGE = 30
  • TRANSFER_TO_BILLED_AR = 31
  • BILLING_CYCLE_CHANGE = 32
  • PERIOD_TERMINATION = 33
  • SUBSCRIBER_ADD_DEVICE = 34
  • SUBSCRIBER_REMOVE_DEVICE = 35
  • GROUP_ADD_MEMBERSHIP = 36
  • GROUP_REMOVE_MEMBERSHIP = 37
  • REFUND = 38
  • PAYMENT_REFUND = 39
  • PERIOD_WRITE_OFF = 40
  • PURCHASED_ITEM_CYCLE_CHANGE = 41
  • RECHARGE_REQUEST = 42
  • PURCHASED_ITEM_ACTIVATION = 43
  • BALANCE_THRESHOLD = 44
  • PURCHASED_ITEM_TRANSITION_TO_INACTIVE = 45
  • METER_PERIOD_CLOSE = 46
  • CONTRACT_LATE_CHARGE = 47
  • FINANCE_CONTRACT_PRINCIPAL_PAYMENT = 48
  • MISSED_CONTRACT_CHARGE = 49
  • CONTRACT_FINANCE = 50
  • CONTRACT_DEBT_PAYMENT = 51
  • PURCHASED_ITEM_MODIFY = 52
  • COMPONENT_METER_PERIOD_CLOSE = 53
  • SUBSCRIPTION_MODIFY = 54
  • GROUP_MODIFY = 55
  • USER_MODIFY = 56
  • DEVICE_MODIFY = 57
  • SUBSCRIPTION_CREATE = 58
  • GROUP_CREATE = 59
  • DEVICE_CREATE = 60
  • USER_CREATE = 61
  • SUBSCRIPTION_DELETE = 62
  • GROUP_DELETE = 63
  • DEVICE_DELETE = 64
  • USER_DELETE = 65
  • COMPONENT_METER_SUBPERIOD_CLOSE = 66
  • CYCLE_ARREARS_RECURRING = 67
  • DEBT_PAYMENT = 71
  • PURCHASED_ITEM_STATUS_CHANGE = 72
  • FEE_CHARGE = 73
  • EXTERNAL_PAYMENT_REQUEST = 74
  • EXTERNAL_PAYMENT = 75
  • PERIOD_END_TIME_CHANGE = 76
  • SESSION_MONITOR = 77
  • EXTERNAL_PAYMENT_FAILURE = 78
  • PURCHASE_FAILURE = 79
  • PURCHASED_ITEM_ACTIVATION_FAILURE = 80
  • RECURRING_FAILURE = 81
  • USAGE_FAILURE = 82
  • BALANCE_TRANSFER_FAILURE = 83
  • PURCHASE_PACKAGE_MODIFY = 84
  • BALANCE_THRESHOLD_MODIFY = 85
  • POLICY_SESSION_END = 86
  • ROAMING_POLICY_SESSION_START = 87
  • ROAMING_POLICY_CHANGE = 88
  • ROAMING_POLICY_SESSION_END = 89
  • PURCHASED_ITEM_PERIOD_CLOSING = 90
  • PURCHASED_ITEM_CLOSE = 91
  • DYNAMIC_BALANCE_INSTANCE_CREATE = 92
  • RECURRING_RECHARGE_RETRY_FAILURE = 93
  • IMPORT_WAKE = 94
EventTypeArray Array of String Events whose event type prefix matches one of the specified types will be returned. Event types are like "4", "1.2", or "1.3.5".

Query Size

The following query with querySize and queryCursor parameters limits the query size to two events and begins the query at the specified cursor value which was returned in a previous query.

GET http://host:port/rsgateway/data/v3/group/1-2-3-4/events/?querySize=2&queryCursor=1125899907043728

Event DateTime Range

The following query with the eventTimeLowerBound parameter gets events which occurred after 2016-08-01 00:00:00 PDT for a subscriber with OID 1-2-3-4.

GET http://host:port/rsgateway/data/v3/subscriber/1-2-3-5/events?eventTimeLowerBound=2016-08-01T00%3A00%3A00-07%3A00
 

Query by eventType

The following query with the eventType parameter gets events with event type prefix 4 and 1.2.
GET http://host:port/rsgateway/data/v3/device/1-2-3-6/events?eventTypes=4,1.2
This query returns events for device 1-2-3-6 with the following event types:
  • 4
  • 4.1
  • 4.2
  • 1.2.1
  • 1.2.2

Sample Event Query Responses

XML
<MtxResponseEventInfo>
  <EventList>
    <MtxPurchaseEvent>
      <OfferInfoArray>
        <MtxPurchaseEventOfferInfo>
          <CatalogItemId>2</CatalogItemId>
          <CatalogItemExternalId>9</CatalogItemExternalId>
          <CatalogItemTemplateAttr>
            <MtxTemplateAttr />
          </CatalogItemTemplateAttr>
          <OfferId>2</OfferId>
          <OfferVersion>0</OfferVersion>
          <ExternalId>9</ExternalId>
          <ResourceId>1</ResourceId>
          <StartTime>0001-01-01T00:00:00.000000Z</StartTime>
          <EndTime>65535-12-31T23:59:59.999999Z</EndTime>
        </MtxPurchaseEventOfferInfo>
      </OfferInfoArray>
      <EventTypeArray>
        <value>4</value>
      </EventTypeArray>
      <InitiatorId>0-1-5-24</InitiatorId>
      <InitiatorExternalId>123</InitiatorExternalId>
      <Flags>0</Flags>
      <WalletId>0-1-5-25</WalletId>
      <WalletOwnerId>0-1-5-24</WalletOwnerId>
      <WalletOwnerExternalId>123</WalletOwnerExternalId>
      <EventTime>2017-10-17T02:21:44.000471Z</EventTime>
      <EventId>GLDQA_0:1:52:45</EventId>
      <DeleteCode>2</DeleteCode>
    </MtxPurchaseEvent>
    <MtxPurchaseEvent>
      <OfferInfoArray>
        <MtxPurchaseEventOfferInfo>
          <CatalogItemId>2</CatalogItemId>
          <CatalogItemExternalId>9</CatalogItemExternalId>
          <CatalogItemTemplateAttr>
            <MtxTemplateAttr />
          </CatalogItemTemplateAttr>
          <OfferId>2</OfferId>
          <OfferVersion>0</OfferVersion>
          <ExternalId>9</ExternalId>
          <ResourceId>2</ResourceId>
          <StartTime>0001-01-01T00:00:00.000000Z</StartTime>
          <EndTime>65535-12-31T23:59:59.999999Z</EndTime>
        </MtxPurchaseEventOfferInfo>
      </OfferInfoArray>
      <EventTypeArray>
        <value>4</value>
      </EventTypeArray>
      <InitiatorId>0-1-5-24</InitiatorId>
      <InitiatorExternalId>123</InitiatorExternalId>
      <Flags>0</Flags>
      <WalletId>0-1-5-25</WalletId>
      <WalletOwnerId>0-1-5-24</WalletOwnerId>
      <WalletOwnerExternalId>123</WalletOwnerExternalId>
      <EventTime>2017-10-17T02:22:08.731478Z</EventTime>
      <EventId>GLDQA_0:1:52:46</EventId>
      <DeleteCode>2</DeleteCode>
    </MtxPurchaseEvent>
  </EventList>
  <QueryCursor>0</QueryCursor>
  <RouteId>1</RouteId>
  <Result>0</Result>
  <ResultText>OK</ResultText>
  <ResultType>GET</ResultType>
</MtxResponseEventInfo>
JSON
{
  "$": "MtxResponseEventInfo",
  "EventList": [
    {
      "$": "MtxPurchaseEvent",
      "DeleteCode": 2,
      "EventId": "GLDQA_0:1:52:45",
      "EventTime": "2017-10-17T02:21:44.000471Z",
      "EventTypeArray": [
        4
      ],
      "Flags": 0,
      "InitiatorExternalId": "123",
      "InitiatorId": "0-1-5-24",
      "OfferInfoArray": [
        {
          "$": "MtxPurchaseEventOfferInfo",
          "CatalogItemExternalId": "9",
          "CatalogItemId": 2,
          "CatalogItemTemplateAttr": {
            "$": "MtxTemplateAttr"
          },
          "EndTime": "65535-12-31T23:59:59.999999Z",
          "ExternalId": "9",
          "OfferId": 2,
          "OfferVersion": 0,
          "ResourceId": 1,
          "StartTime": "0001-01-01T00:00:00.000000Z"
        }
      ],
      "WalletId": "0-1-5-25",
      "WalletOwnerExternalId": "123",
      "WalletOwnerId": "0-1-5-24"
    },
    {
      "$": "MtxPurchaseEvent",
      "DeleteCode": 2,
      "EventId": "GLDQA_0:1:52:46",
      "EventTime": "2017-10-17T02:22:08.731478Z",
      "EventTypeArray": [
        4
      ],
      "Flags": 0,
      "InitiatorExternalId": "123",
      "InitiatorId": "0-1-5-24",
      "OfferInfoArray": [
        {
          "$": "MtxPurchaseEventOfferInfo",
          "CatalogItemExternalId": "9",
          "CatalogItemId": 2,
          "CatalogItemTemplateAttr": {
            "$": "MtxTemplateAttr"
          },
          "EndTime": "65535-12-31T23:59:59.999999Z",
          "ExternalId": "9",
          "OfferId": 2,
          "OfferVersion": 0,
          "ResourceId": 2,
          "StartTime": "0001-01-01T00:00:00.000000Z"
        }
      ],
      "WalletId": "0-1-5-25",
      "WalletOwnerExternalId": "123",
      "WalletOwnerId": "0-1-5-24"
    }
  ],
  "QueryCursor": 0,
  "Result": 0,
  "ResultText": "OK",
  "RouteId": 1,
  "_resultCode": 0,
  "_resultText": "OK",
  "_resultType": "get"
}