This topic sets out in detail the objects that feature in the Events and Notifications framework. The relevant API calls you can use with each object are noted together with examples of object JSON schemas:Documentation Index
Fetch the complete documentation index at: https://docs.m3ter.com/llms.txt
Use this file to discover all available pages before exploring further.
- Event Types
- Event Fields
- Events
- Notification Rule
- Outgoing Webhooks and Credentials
- Integration Configuration for Notification
Event Types
Events Types cover:- Many of the common configuration and billing objects:
- For each object there are three Event Types - for when the configuration or billing object is created, updated, or deleted.
- Some integration errors. These are surfaced in the Console on the Integrations>Events page. See Reviewing and Resolving Integration Events.
- Some ingest validation failures. These are surfaced in the Console on the Usage>Ingest Events page. See Reviewing and Resolving Ingest Events.
- Data export job failures. You can return these using the List EventResponse API endpoint. See Following-Up on Failed Export Jobs for more details.
- Scheduled Events you can set up for your specific Organization. See Working with Scheduled Events.
API Call
To obtain a list of the Event Types currently available for configuring Notifications, you can use the List Notification Events API call:GET https://api.m3ter.com/organizations/{orgId}/events/types
The return lists the available Event Types:
- Note that is you’ve set up any Scheduled Events for your Organization, these will be included in the response to this call. The format for this type of Event is:
- scheduled.<name of entity>.<custom event name>
- For example:
"scheduled.bill.endDateEvent" - See Working with Scheduled Events for more details.
Event Fields
Fields are available for each Event Type to make any calculations on the schema dynamic and forward compatible.API Call
To obtain a list of the fields for an Event Type, you can use the List Event Fields call:GET https://api.m3ter.com/organizations/{orgId}/events/fields
Query Parameters
eventName (String) - the name of the Event Type to filter by.
Here we’ve queried to get the field for the configuration.commitment.created Event Type - new represents the attributes the new object has:
configuration.commitment.updated Event Type, where new is the updated object and old is the previous state of the object:
new and old values, where the old field values are those from the previous version and new are the updated version values.
Correspondingly, if you query for configuration.commitment.deleted Event, the response will show only old field values, which are the values at point of deletion.
Events
Events are instances of available Event Types. They describe a state change in the system.API Call
You can use the List Event Response call to obtain a list of all Events and apply a filter orGET by id.
Query Parameters
eventName (String)- the name of the event to filter by.notificationId (String)- the notification id to filter by.accountId (String)- the account Id that generated the event to filter by.eventType (String)- the name of the event to filter by.notificationCode (String)- the code of the notification to filter by.resourceId (String)- the id of the resource that triggered the event to filter by.ids(String)- List of ids to filter by. NOTE: cannot be used with other filters.nextToken (String)- next page token.pageSize (int)- page size.
eventName:
GET https://api.m3ter.com/organizations/{orgId}/events?eventName=configuration.commitment.created
In this example, we see that there is a single configuration.commitment.created Event for the Organization:
Notification Rule
Enables you to set up the rules for when a Notification gets triggered on the basis of an Event.API Calls
You can use the API calls documented in the Notifications section of our API Reference Docs - supportsPOST, PUT, DELETE, GET by id, or GET list verbs.
Here’s an example schema:
calculation- is the key part, determining whether or not an Event will trigger a Notification. Please see the Creating Calculations section for more details on working with calculations for Notifications.active- allows you to temporarily disable a Notification.eventName- the calculation will be applied only on these specific events. To apply the same calculation over multiple events, multiple notification rules need to be created.
Outgoing Webhooks and Credentials
You can specify the endpoint for a Notification using an Outgoing Webhook. You can also specify credentials to be used with the Outgoing Webhook. Currently, only theM3TER_SIGNED_REQUEST credential format is supported:
apiKey- secret that will always be passed in “X-m3ter-apikey” header when the webhook is called.Secret- secret that never leaves m3ter servers. Used as key to compute a SHA256 hash over: url + ”|” + queryString + ”|” + apiKey + ”|” + timestamp + ”|” + body.- The timestamp will be passed in the request at “X-m3ter-timestamp”.
API Calls
You can use the webhooks Destination calls documented in the Integrations section of our API Reference Docs - supports allPOST, PUT, DELETE, GET by id or GET list verbs. For example Create Webhook Destination:
POST https://api.m3ter.com/organizations/{orgId}/integrationdestinations/webhooks
Here’s an example of the Destination schema:
Integration Configuration for Notification
When you connect a Notification Rule of entityType (=’Notification’) to an Outgoing Webhook as destination, you set up a Notification Webhook Integration.API Calls
You can use the IntegrationConfig calls documented in the Integrations section of our API Reference Docs - supports allPOST, PUT, DELETE, GET by id or GET list verbs.
Here’s an example: