WS1 UEM Event Notifications
This guide demonstrates how to leverage Workspace One UEM's Event Notifications feature to automate device management workflows. The tutorial walks through creating a serverless automation that tags devices upon enrollment using Pipedream and UEM APIs.
Event Notifications Explained
According to the documentation, "Event Notifications in Workspace One UEM allow the UEM console to send a notification of an event in the UEM console, such as a device enrollment, unenrollment, compliance status change, etc. to another service via HTTP methods."
Setup Requirements
- Admin access to a Workspace One UEM console
- A test device for enrollment/unenrollment testing
- A Pipedream account (free tier available)
Pipedream Workflow Setup
- Create a new workflow with an HTTP/Webhook trigger that generates a unique URL
- Add a Node.js code action to process incoming events
- Deploy the workflow to make it live and accessible
UEM Configuration
- Navigate to Groups & Settings > System > Advanced > API > Event Notifications
- Create a new rule targeting the Pipedream webhook URL
- Set format to JSON for structured data
- Test the connection from the UEM console
- Enable device enrollment events to trigger notifications
Device Tags
Before automation, create a device tag in Groups & Settings > Devices & Users > Advanced > Tags. Note the tag ID from the URL when viewing the tag details—this becomes essential for the API integration.
API Access Preparation
- REST API Key: Generate in System > Advanced > API > REST API
- Admin Account: Create a dedicated administrator with API access permissions
Implementation Code
const axios = require("axios")
const resp = await axios({
method: "POST",
url: `https://as1.awmdm.com/API/mdm/tags/{TagID}/adddevices`,
data: {
"BulkValues": {
"Value": [steps.trigger.event.body.DeviceId]
}
},
headers: {
'aw-tenant-code': 'YourApiKey',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
auth: {
username: 'AdminUsername',
password: 'AdminPassword'
}
})
this.data = resp.dataImportant: Replace placeholder values with actual credentials. The code dynamically extracts the DeviceId from enrollment notifications.
Conclusion
While basic tag application may have limited production value, this foundation enables more sophisticated automations. You could expand the logic to tag devices based on various criteria, trigger actions in external systems, or respond to different UEM events entirely.