Sky Ledge Docs
  • Welcome
  • Getting Started
    • Creating Your Account
    • Sky Ledge API - Quick start
    • Developer Guide
      • Creating A Control Room
      • Creating Event Types
      • Creating Events (aka Alerts or Notifications)
      • Creating Asset Types
      • Linking Asset Types to a Control Room
      • Creating Assets
      • Creating and Tracking a Metric
      • Future Updates
  • Fundamentals
    • Launchpad
    • Control Rooms
    • Assets
    • Events
    • Places
    • Cycles
    • Widgets
  • API Docs
  • Client Libraries
    • NodeJs
  • Community
    • Where to find us
  • Knowledge Base
    • Articles
      • What is a LaunchPad
      • What is a Control Room
      • How to use the maps controls and layers options
      • Map marker explained
      • Navigating your profile
      • What is an Event
      • What is an Event Type
      • Exploring the event stream
      • Event Stream Filtering
      • What is an Asset
      • What are asset types
      • Understanding Focus Mode
      • Navigating Asset List Mode
      • Table column selection
      • Asset metrics
      • What is a place
      • Searching and Creating a Place
      • Getting Started with Place Notifications
      • Places and how to use the gatehouse report
      • How to use the Event Report (Top-down Investigations Module)
      • What is a Task
      • How to process a task
      • Task Notifications
      • How to invite a work colleague
      • How to submit an awesome ticket
      • Understanding Your Weekly Email Reports
      • Knowledge Base Template
    • What's New
    • Archived - What's News
Powered by GitBook
On this page
  • Creating Event Types - Using the interface
  • Creating Event Types - Using the API
  1. Getting Started
  2. Developer Guide

Creating Event Types

PreviousCreating A Control RoomNextCreating Events (aka Alerts or Notifications)

Last updated 2 years ago

Recap: What are Event Types?

Event types describe the types of information or insights you'd like to see in your Control Room. Click here to learn more about Event Types.

Creating Event Types - Using the interface

Event types can be created through the UI in four simple steps:

  1. Open the Control Room you created in the previous step (Heroes Flying Potion - Real-time Monitoring)

  2. In the side panel, click ‘Manage Event Types’

  3. Then click “Add New Event Type”

  4. Fill out the details for your Event Types

Here are the steps visually:

Event Types describe the types of alerts you want to receive. Our first Event Type could be letting us know that a Hero (Flying Potion customer) is flying in a given location.

So here’s how we’d fill out the Event Type details:

When we save the Event Type, we’re taken back to our ‘Manage Event Types’ section and can see our first Event Type “Customer Flying” in our Event Type Library:

Let’s unpack the Event Type we created:

  1. Name your event: This is a way for you to label your Event Types in a way that make sense to you as a business. You could choose to use a naming convention or simply give it a descriptive name so you know what it’s referring to. This is purely for organisational purposes and doesn’t appear in your Control Room or Event Stream.

  2. Title: This is the title that appears in your event stream. You want to keep this concise to convey what you’re after. Notice that location is written between curly braces {{location}}. This ensures that each event will be able to replace {{location}} with the actual location the event took place in. These are called “placeholders”, you can create any number of placeholders so that external systems can push different types of information into your events, giving you richer, event specific insights.

  3. Description: A bit more detail that appears under the title. Similar to the title, you can include placeholders here to give you specific insights. In this case we’re displaying our customer’s first name using {{customerFirstName}}

  4. Importance Level: Different Event Types can have different importance ratings. This allows you to specify a default, but external systems can override this (some events might need to be rated as critical, and others as low priority)

Creating Event Types - Using the API

Similar to what we did using the interface, we can create our Event Types via API. Here are a few Event Types (including the one we created previously) using API calls:

Creating Event Type - Customer Flying

POST api.skyledge.com/event-types

{  
   "name":"Customer Flying",
   "title":"Customer flying in {{location}}",
   "description":"{{customerFirstName}} successfully took off.",
   "locationType":"Point",
   "defaultImportanceLevel":0,
   "controlRooms":[  
      "CONTROL_ROOM_ID"
   ]
}
curl --location --request POST 'https://api.skyledge.com/event-types' \
--header 'X-Authorization: API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{  
   "name":"Customer Flying",
   "title":"Customer flying in {{location}}",
   "description":"{{customerFirstName}} successfully took off.",
   "locationType":"Point",
   "defaultImportanceLevel":0,
   "controlRooms":[  
      "CONTROL_ROOM_ID"
   ]
}'
import { Configuration, EventTypeRequest, EventTypesApi } from '@skyledge/sdk';

const configuration = new Configuration({
  apiKey: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX',
  basePath: 'https://api.skyledge.com',
});

const controlRoomId = CONTROL_ROOM_ID;

const data: Partial<EventTypeRequest> = {
  name: 'Customer Flying',
  title: 'Customer flying in {{location}}',
  description: '{{customerFirstName}} successfully took off.',
  locationType: 'Point',
  defaultImportanceLevel: 0,
  controlRooms: [controlRoomId],
};

const eventTypeApi = new EventTypesApi(configuration);

const newEventType = await eventTypeApi.createAnEventType(data);

console.log(newEventType.status);
import requests
import json

url = "https://api.skyledge.com/event-types"

payload = json.dumps({
  "name": "Customer Flying",
  "title": "Customer flying in {{location}}",
  "description": "{{customerFirstName}} successfully took off.",
  "locationType": "Point",
  "defaultImportanceLevel": 0,
  "controlRooms": [
    "CONTROL_ROOM_ID"
  ]
})
headers = {
  'X-Authorization': 'API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Creating Event Type - Prohibited Airspace Intrusion

POST api.skyledge.com/event-types

{  
   "name":"Prohibited Airspace Intrusion",
   "title":"Flying Person Detected in {{location}} - Prohibited Airspace",
   "description":"A flying person has been detected in a prohibited airspace",
   "locationType":"Point",
   "defaultImportanceLevel":2,
   "controlRooms":[  
      "{controlRoomId}"
   ]
}
curl --location --request POST 'https://api.skyledge.com/event-types' \
--header 'X-Authorization: API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{  
   "name":"Prohibited Airspace Intrusion",
   "title":"Flying Person Detected in {{location}} - Prohibited Airspace",
   "description":"A flying person has been detected in a prohibited airspace",
   "locationType":"Point",
   "defaultImportanceLevel":2,
   "controlRooms":[  
      "CONTROL_ROOM_ID"
   ]
}'
import { Configuration, EventTypeRequest, EventTypesApi } from '@skyledge/sdk';

const configuration = new Configuration({
  apiKey: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX',
  basePath: 'https://api.skyledge.com',
});

const controlRoomId = CONTROL_ROOM_ID;
const location = LOCATION;

const data: Partial<EventTypeRequest> = {
  name: 'Prohibited Airspace Intrusion',
  title: `Flying Person Detected in {{${location}}} - Prohibited Airspace`,
  description: 'A flying person has been detected in a prohibited airspace',
  locationType: 'Point',
  defaultImportanceLevel: 2,
  controlRooms: [controlRoomId],
};

const eventTypeApi = new EventTypesApi(configuration);

const newEventType = await eventTypeApi.createAnEventType(data);

console.log(newEventType.status);
import requests
import json

url = "https://api.skyledge.com/event-types"

payload = json.dumps({
  "name": "Prohibited Airspace Intrusion",
  "title": "Flying Person Detected in {{location}} - Prohibited Airspace",
  "description": "A flying person has been detected in a prohibited airspace",
  "locationType": "Point",
  "defaultImportanceLevel": 2,
  "controlRooms": [
    "CONTROL_ROOM_ID"
  ]
})
headers = {
  'X-Authorization': 'API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Creating Event Type - Potion Ineffective

POST api.skyledge.com/event-types

{  
   "name":"Potion Ineffective",
   "title":"Potion ineffective on customer in {{location}}",
   "description":"A customer in {{location}} has consumed the potion with no effect",
   "locationType":"Point",
   "defaultImportanceLevel":2,
   "controlRooms":[  
      "{controlRoomId}"
   ]
}
curl --location --request POST 'https://api.skyledge.com/event-types' \
--header 'X-Authorization: API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{  
   "name":"Potion Ineffective",
   "title":"Potion ineffective on customer in {{location}}",
   "description":"A customer in {{location}} has consumed the potion with no effect",
   "locationType":"Point",
   "defaultImportanceLevel":2,
   "controlRooms":[  
      "CONTROL_ROOM_ID"
   ]
}'
import { Configuration, EventTypeRequest, EventTypesApi } from '@skyledge/sdk';

const configuration = new Configuration({
  apiKey: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX',
  basePath: 'https://api.skyledge.com',
});

const controlRoomId = CONTROL_ROOM_ID;
const location = LOCATION;

const data: Partial<EventTypeRequest> = {
  name: 'Potion Ineffective',
  title: `Potion ineffective on customer in {{${location}}}`,
  description: `A customer in {{${location}}} has consumed the potion with no effect`,
  locationType: 'Point',
  defaultImportanceLevel: 2,
  controlRooms: [controlRoomId],
};

const eventTypeApi = new EventTypesApi(configuration);

const newEventType = await eventTypeApi.createAnEventType(data);

console.log(newEventType.status);
import requests
import json

url = "https://api.skyledge.com/event-types"

payload = json.dumps({
  "name":"Potion Ineffective",
  "title":"Potion ineffective on customer in {{location}}",
  "description":"A customer in {{location}} has consumed the potion with no effect",
  "locationType":"Point",
  "defaultImportanceLevel":2,
  "controlRooms": [
    "CONTROL_ROOM_ID"
  ]
})
headers = {
  'X-Authorization': 'API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

3 Event Types created with 3 API calls!

How your Control Room will look
Where to click to Create an 'Event Type'
Event Types page. Yours will be empty. Click 'Add a new Event Type' to create a new one
What the page looks like when you click 'Add a new Event Type'
Example Event Type
Our first created Event Type