Skip to main content
Aria Knowledge Central

subscribe_event_class_m Sample Call and Response

This example shows a client subscribing to the Usage Monitoring event class, based on the subscribe_event_class_m method defined in plsql_m_r73.yml.

This example covers subscribing to one event class and shows one representative event returned in the events array. It does not cover the do_write field, which lets a caller preview the effects of the subscription without actually performing it, since this example performs the subscription directly.

Sample call

{
  "rest_call": "subscribe_event_class_m",
  "output_format": "json",
  "client_no": 12345,
  "auth_key": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "class_no": 5
}

The rest_call and output_format fields are added by the REST layer and are not part of the method's own argument list. The class_no field is required and uses a five-value enumeration identifying the event class: one is Accounts, two is Orders, three is Financial Transactions, four is Account Notifications, and five is Usage Monitoring; this example selects five, subscribing the client to events related to monitoring account usage values, balances, and thresholds.

Sample response

{
  "events": [
    {
      "event_id": 5010,
      "event_name": "usage_threshold_crossed",
      "event_description": "Fires when an account's unbilled usage balance crosses a configured threshold.",
      "event_state": "active"
    }
  ],
  "error_code": 0,
  "error_msg": "OK"
}

An error_code value of zero, together with an error_msg value of "OK", indicates that Aria successfully subscribed the client to the Usage Monitoring event class. A nonzero error_code, paired with a descriptive error_msg, indicates that the subscription did not complete, for example because the client was already subscribed to the class. The events array lists the individual events that belong to the newly subscribed class; this example shows only one representative entry, but the Usage Monitoring class contains multiple individual events, so a real response typically includes more than one entry, each with its own event_id, event_name, event_description, and event_state. This example leaves out the error_details field, since that field is internal to Aria and is not returned to callers.

TOP
  • Was this article helpful?