How to use the Rest API to manage SIGNL4 categories

Sep 20, 2023 | Developer

SIGNL4 Categories

The categories in SIGNL4 are a powerful tool to make it clear to users at first glance what a particular alert is about. For example, colors, icons, location and predefined texts can be configured here.

Categories can be created and edited manually.

Manage Categories automatically

In certain circumstances it can be useful to create or delete categories automatically. This can be the case, for example, if you have multiple teams and they only want to use certain categories, or even if you want to equip a SIGNL4 account with your categories before handing it over to one of your customers, for example. This can greatly simplify the onboarding process for SIGNL4 teams.

Use the REST API

The SIGNL4 REST API offers functions, to add, delete and manage categories. In order to use the API you first need a SIGNL4 API Key. You get this one in the SIGNL4 We portal under Integrationen -> API Keys.

The following functions are especially helpful for managing the categories.


# Get Teams
# As a result you get the team id(s) that you need in the next steps
GET https://connect.signl4.com/api/teams
X-S4-Api-Key: your-api-key

# Get Categories
# Get all categories for the given team
GET https://connect.signl4.com/api/categories/your-team-id
X-S4-Api-Key: your-api-key

# Add Category
POST https://connect.signl4.com/api/categories/your-team-id
X-S4-Api-Key: your-api-key
Content-Type: application/json
Accept: application/json

{
"augmentations": [
{
"enabled": false,
"name": "",
"type": "Subject",
"value": ""
},
{
"enabled": false,
"name": "",
"type": "Location",
"value": ""
},
{
"enabled": false,
"name": "",
"type": "Text",
"value": ""
}
],
"color": "#30AFE5",
"imageName": "bug.svg",
"keywordMatching": "Any",
"keywords": [
"keyword1",
"keyword2"
],
"name": "My New Category"
}

# Delete Category (team id / category id)
DELETE https://connect.signl4.com/api/categories/your-team-id/your-category-id
X-S4-Api-Key: your-api-key

By the way, the above codes can be used with Visual Studio Code. With the REST Client extension you can also call and test the requests directly from there. This is quite convenient and maybe also an option to simplify the category creation.

You can learn about category based alerting here.

Automation with Node-RED

To automate the creation or deletion of categories, you can use, for example, no-code platforms such as Make.com, n8n, or Node-RED. We have provided an example of a Node-RED flow that creates a category. There, the functions with the parameters (API Key and Team ID) still have to be adjusted.

Discover SIGNL4

SIGNL4 Alerting App

Stay ahead of critical incidents with SIGNL4 and its superpowers. SIGNL4 provides superior and automated mobile alerting, delivers alerts to the right people at the right time and enables operations teams to respond and to manage incidents from anywhere.

Learn more about SIGNL4 and start your free 30-days trial.