Page tree
Skip to end of metadata
Go to start of metadata

This page contains a comprehensive reference for Webhooks, a feature of the JSS introduced in 9.93.

The Webhooks API is an HTTP front-end for the underlying Events API (a Java based API meant for plugins installed on the server). Webhooks take JSS Events and send them to designated URLs in either XML or JSON format as an HTTP POST request. These are real-time notifications that trigger when the event occurs in the JSS. Using webhooks, an admin or developer can create robust integrations to the JSS and workflows for their management environment (these will be referred to as services throughout the rest of this article).

All examples provided with this documentation are not meant for production use. Use them for reference or starting points, but thoroughly test before using anything in production.




Additional Information

For additional information, see the following section of the Casper Suite Administrator's Guide:

Webhooks

Learn about configuring webhooks in the JSS. 

Supporting Articles

Best Practices

A collection of best practices when creating a webhook integration.

Example Integration using Python and Flask

Get started with your own JSS webhook integrations with two easy to use tools: the Python programming language and the simple but powerful microframwork Flask.

Security Considerations




Table of Contents

 





Webhook API Reference

The following table is a full reference to the Webhooks API. The JSON and XML data represent the notifications your service will receive from the JSS.

Every webhook event contains two objects: the webhook and the event. The webhook object details which created webhook in the JSS sent the event. This will contain the JSS ID of the webhook, it's name and the type of event that it is. The event object contains the data pertaining the to the webhook event. Many webhook events send the same event object (e.g.. all computer events and all mobile device events).

The reference below will display the full JSON and XML for the first webhook event that contains that event object type along with a label. The others will reference the label and be collapsed (they are still provided to show the webhook object in context with the event object).

DescriptionJSONXML

ComputerAdded

A new computer has been enrolled to the JSS.

This only applies to new computer records and not re-enrolled computers.

Event Object: Computer

JSON Example
{
  "webhook": {
    "id": 1,
    "name": "ComputerAdded Webhook",
    "webhookEvent": "ComputerAdded"
  },
  "event": {
    "udid": "",
    "deviceName": "",
    "model": "",
    "macAddress": "",
    "alternateMacAddress": "",
    "serialNumber": "",
    "osVersion": "",
    "osBuild": "",
    "userDirectoryID": "-1",
    "username": "",
    "realName": "",
    "emailAddress": "",
    "phone": "",
    "position": "",
    "department": "",
    "building": "",
    "room": "",
    "jssID": 1
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>1</id>
        <name>ComputerAdded Webhook</name>
        <webhookEvent>ComputerAdded</webhookEvent>
    </webhook>
    <eventObject>
        <udid></udid>
        <deviceName/>
        <model/>
        <macAddress></macAddress>
        <alternateMacAddress></alternateMacAddress>
        <serialNumber/>
        <osVersion/>
        <osBuild/>
        <userDirectoryID>-1</userDirectoryID>
        <username/>
        <realName/>
        <emailAddress/>
        <phone/>
        <position/>
        <department/>
        <building/>
        <room/>
        <jssID>1</jssID>
    </eventObject>
</JSSEvent>

ComputerCheckIn

A computer has checked into the JSS.

Event Object: Computer

JSON Example
{
  "webhook": {
    "id": 2,
    "name": "ComputerCheckin Webhook",
    "webhookEvent": "ComputerCheckin"
  },
  "event": {
    "udid": "",
    "deviceName": "",
    "model": "",
    "macAddress": "",
    "alternateMacAddress": "",
    "serialNumber": "",
    "osVersion": "",
    "osBuild": "",
    "userDirectoryID": "-1",
    "username": "",
    "realName": "",
    "emailAddress": "",
    "phone": "",
    "position": "",
    "department": "",
    "building": "",
    "room": "",
    "jssID": 1
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>2</id>
        <name>ComputerCheckin Webhook</name>
        <webhookEvent>ComputerCheckin</webhookEvent>
    </webhook>
    <eventObject>
        <udid></udid>
        <deviceName/>
        <model/>
        <macAddress></macAddress>
        <alternateMacAddress></alternateMacAddress>
        <serialNumber/>
        <osVersion/>
        <osBuild/>
        <userDirectoryID>-1</userDirectoryID>
        <username/>
        <realName/>
        <emailAddress/>
        <phone/>
        <position/>
        <department/>
        <building/>
        <room/>
        <jssID>1</jssID>
    </eventObject>
</JSSEvent>

ComputerInventoryCompleted

A computer has submitted an inventory report to the JSS.

Event Object: Computer

JSON Example
{
  "webhook": {
    "id": 3,
    "name": "ComputerInventoryCompleted Webhook",
    "webhookEvent": "ComputerInventoryCompleted"
  },
  "event": {
    "udid": "",
    "deviceName": "",
    "model": "",
    "macAddress": "",
    "alternateMacAddress": "",
    "serialNumber": "",
    "osVersion": "",
    "osBuild": "",
    "userDirectoryID": "-1",
    "username": "",
    "realName": "",
    "emailAddress": "",
    "phone": "",
    "position": "",
    "department": "",
    "building": "",
    "room": "",
    "jssID": 1
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>3</id>
        <name>ComputerInventoryCompleted Webhook</name>
        <webhookEvent>ComputerInventoryCompleted</webhookEvent>
    </webhook>
    <eventObject>
        <udid></udid>
        <deviceName/>
        <model/>
        <macAddress></macAddress>
        <alternateMacAddress></alternateMacAddress>
        <serialNumber/>
        <osVersion/>
        <osBuild/>
        <userDirectoryID>-1</userDirectoryID>
        <username/>
        <realName/>
        <emailAddress/>
        <phone/>
        <position/>
        <department/>
        <building/>
        <room/>
        <jssID>1</jssID>
    </eventObject>
</JSSEvent>

ComputerPolicyFinished

A computer has completed running a policy.

Event Object: Computer

JSON Example
{
  "webhook": {
    "id": 4,
    "name": "ComputerPolicyFinished Webhook",
    "webhookEvent": "ComputerPolicyFinished"
  },
  "event": {
    "udid": "",
    "deviceName": "",
    "model": "",
    "macAddress": "",
    "alternateMacAddress": "",
    "serialNumber": "",
    "osVersion": "",
    "osBuild": "",
    "userDirectoryID": "-1",
    "username": "",
    "realName": "",
    "emailAddress": "",
    "phone": "",
    "position": "",
    "department": "",
    "building": "",
    "room": "",
    "jssID": 1
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>4</id>
        <name>ComputerPolicyFinished Webhook</name>
        <webhookEvent>ComputerPolicyFinished</webhookEvent>
    </webhook>
    <eventObject>
        <udid></udid>
        <deviceName/>
        <model/>
        <macAddress></macAddress>
        <alternateMacAddress></alternateMacAddress>
        <serialNumber/>
        <osVersion/>
        <osBuild/>
        <userDirectoryID>-1</userDirectoryID>
        <username/>
        <realName/>
        <emailAddress/>
        <phone/>
        <position/>
        <department/>
        <building/>
        <room/>
        <jssID>1</jssID>
    </eventObject>
</JSSEvent>

ComputerPushCapabilityChanged

A computer's MDM capability has changed (from "Yes" to "No" and vice versa).

Event Object: Computer

JSON Example
{
  "webhook": {
    "id": 5,
    "name": "ComputerPushCapabilityChanged Webhook",
    "webhookEvent": "ComputerPushCapabilityChanged"
  },
  "event": {
    "udid": "",
    "deviceName": "",
    "model": "",
    "macAddress": "",
    "alternateMacAddress": "",
    "serialNumber": "",
    "osVersion": "",
    "osBuild": "",
    "userDirectoryID": "-1",
    "username": "",
    "realName": "",
    "emailAddress": "",
    "phone": "",
    "position": "",
    "department": "",
    "building": "",
    "room": "",
    "jssID": 1
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>5</id>
        <name>ComputerPushCapabilityChanged Webhook</name>
        <webhookEvent>ComputerPushCapabilityChanged</webhookEvent>
    </webhook>
    <eventObject>
        <udid></udid>
        <deviceName/>
        <model/>
        <macAddress></macAddress>
        <alternateMacAddress></alternateMacAddress>
        <serialNumber/>
        <osVersion/>
        <osBuild/>
        <userDirectoryID>-1</userDirectoryID>
        <username/>
        <realName/>
        <emailAddress/>
        <phone/>
        <position/>
        <department/>
        <building/>
        <room/>
        <jssID>1</jssID>
    </eventObject>
</JSSEvent> 

JSSShutdown

The JSS web app is shutting down (triggered when the Tomcat process is told to quit).

Event Object: JSS

JSON Example
 {
  "webhook": {
    "id": 7,
    "name": "JSSShutdown Webhook",
    "webhookEvent": "JSSShutdown"
  },
  "event": {
    "institution": "",
    "hostAddress": "",
    "webApplicationPath": "",
    "isClusterMaster": false,
    "jssUrl": ""
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>7</id>
        <name>JSSShutdown Webhook</name>
        <webhookEvent>JSSShutdown</webhookEvent>
    </webhook>
    <eventObject>
        <institution></institution>
        <hostAddress></hostAddress>
        <webApplicationPath></webApplicationPath>
        <isClusterMaster>false</isClusterMaster>
        <jssUrl></jssUrl>
    </eventObject>
</JSSEvent> 

JSSStartup

The JSS web app has completed startup.

This event will only send once all startup tasks have completed and the login screen is accessible.

Event Object: JSS

JSON Example
 {
  "webhook": {
    "id": 8,
    "name": "JSSStartup Webhook",
    "webhookEvent": "JSSStartup"
  },
  "event": {
    "institution": "",
    "hostAddress": "",
    "webApplicationPath": "",
    "isClusterMaster": false,
    "jssUrl": ""
  }
}
XML Example
 <JSSEvent>
    <webhook>
        <id>8</id>
        <name>JSSStartup Webhook</name>
        <webhookEvent>JSSStartup</webhookEvent>
    </webhook>
    <eventObject>
        <institution></institution>
        <hostAddress></hostAddress>
        <webApplicationPath></webApplicationPath>
        <isClusterMaster>false</isClusterMaster>
        <jssUrl></jssUrl>
    </eventObject>
</JSSEvent> 

MobileDeviceCheckIn



A mobile device has checked into the JSS.

Event Object: MobileDevice

JSON Example
 {
  "webhook": {
    "id": 9,
    "name": "MobileCheckin Webhook",
    "webhookEvent": "MobileDeviceCheckIn"
  },
  "event": {
    "udid": "",
    "deviceName": "",
    "version": "",
    "model": "",
    "bluetoothMacAddress": "",
    "wifiMacAddress": "",
    "imei": "",
    "icciID": "",
    "product": null,
    "serialNumber": "",
    "userDirectoryID": "-1",
    "room": "",
    "osVersion": "",
    "osBuild": "",
    "modelDisplay": "",
    "username": "",
    "jssID": 1
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>9</id>
        <name>MobileCheckin Webhook</name>
        <webhookEvent>MobileDeviceCheckIn</webhookEvent>
    </webhook>
    <eventObject>
        <udid></udid>
        <deviceName></deviceName>
        <version></version>
        <model></model>
        <bluetoothMacAddress></bluetoothMacAddress>
        <wifiMacAddress></wifiMacAddress>
        <imei/>
        <icciID/>
        <product/>
        <serialNumber></serialNumber>
        <userDirectoryID>-1</userDirectoryID>
        <room/>
        <osVersion></osVersion>
        <osBuild></osBuild>
        <modelDisplay></modelDisplay>
        <username/>
        <jssID>1</jssID>
    </eventObject>
</JSSEvent>

MobileDeviceCommandCompleted

A mobile device has completed an issued MDM command.

Event Object: MobileDevice

JSON Example
{
  "webhook": {
    "id": 10,
    "name": "MobileDeviceCommandCompleted Webhook",
    "webhookEvent": "MobileDeviceCommandCompleted"
  },
  "event": {
    "udid": "",
    "deviceName": "",
    "version": "",
    "model": "",
    "bluetoothMacAddress": "",
    "wifiMacAddress": "",
    "imei": "",
    "icciID": "",
    "product": null,
    "serialNumber": "",
    "userDirectoryID": "-1",
    "room": "",
    "osVersion": "",
    "osBuild": "",
    "modelDisplay": "",
    "username": "",
    "jssID": 1
  }
} 
XML Example
<JSSEvent>
    <webhook>
        <id>10</id>
        <name>MobileDeviceCommandCompleted Webhook</name>
        <webhookEvent>MobileDeviceCommandCompleted</webhookEvent>
    </webhook>
    <eventObject>
        <udid></udid>
        <deviceName></deviceName>
        <version></version>
        <model></model>
        <bluetoothMacAddress></bluetoothMacAddress>
        <wifiMacAddress></wifiMacAddress>
        <imei/>
        <icciID/>
        <product/>
        <serialNumber></serialNumber>
        <userDirectoryID>-1</userDirectoryID>
        <room/>
        <osVersion></osVersion>
        <osBuild></osBuild>
        <modelDisplay></modelDisplay>
        <username/>
        <jssID>1</jssID>
    </eventObject>
</JSSEvent> 

MobileDeviceEnrolled

A mobile device has been enrolled to the JSS.

Event Object: MobileDevice

JSON Example
{
  "webhook": {
    "id": 11,
    "name": "MobileDeviceEnrolled Webhook",
    "webhookEvent": "MobileDeviceEnrolled"
  },
  "event": {
    "udid": "",
    "deviceName": "",
    "version": "",
    "model": "",
    "bluetoothMacAddress": "",
    "wifiMacAddress": "",
    "imei": "",
    "icciID": "",
    "product": null,
    "serialNumber": "",
    "userDirectoryID": "-1",
    "room": "",
    "osVersion": "",
    "osBuild": "",
    "modelDisplay": "",
    "username": "",
    "jssID": 1
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>11</id>
        <name>MobileDeviceEnrolled Webhook</name>
        <webhookEvent>MobileDeviceEnrolled</webhookEvent>
    </webhook>
    <eventObject>
        <udid></udid>
        <deviceName></deviceName>
        <version></version>
        <model></model>
        <bluetoothMacAddress></bluetoothMacAddress>
        <wifiMacAddress></wifiMacAddress>
        <imei/>
        <icciID/>
        <product/>
        <serialNumber></serialNumber>
        <userDirectoryID>-1</userDirectoryID>
        <room/>
        <osVersion></osVersion>
        <osBuild></osBuild>
        <modelDisplay></modelDisplay>
        <username/>
        <jssID>1</jssID>
    </eventObject>
</JSSEvent>

MobileDevicePushSent

An MDM command has been sent to a mobile device from the JSS.

Event Object: MobileDevice

JSON Example
{
  "webhook": {
    "id": 12,
    "name": "MobileDevicePushSent Webhook",
    "webhookEvent": "MobileDevicePushSent"
  },
  "event": {
    "udid": "",
    "deviceName": "",
    "version": "",
    "model": "",
    "bluetoothMacAddress": "",
    "wifiMacAddress": "",
    "imei": "",
    "icciID": "",
    "product": null,
    "serialNumber": "",
    "userDirectoryID": "-1",
    "room": "",
    "osVersion": "",
    "osBuild": "",
    "modelDisplay": "",
    "username": "",
    "jssID": 1
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>12</id>
        <name>MobileDevicePushSent Webhook</name>
        <webhookEvent>MobileDevicePushSent</webhookEvent>
    </webhook>
    <eventObject>
        <udid></udid>
        <deviceName></deviceName>
        <version></version>
        <model></model>
        <bluetoothMacAddress></bluetoothMacAddress>
        <wifiMacAddress></wifiMacAddress>
        <imei/>
        <icciID/>
        <product/>
        <serialNumber></serialNumber>
        <userDirectoryID>-1</userDirectoryID>
        <room/>
        <osVersion></osVersion>
        <osBuild></osBuild>
        <modelDisplay></modelDisplay>
        <username/>
        <jssID>1</jssID>
    </eventObject>
</JSSEvent>

MobileDeviceUnEnrolled

A mobile device has been un-enrolled from the JSS.

Event Object: MobileDevice

JSON Example
{
  "webhook": {
    "id": 13,
    "name": "MobileDeviceUnEnrolled Webhook",
    "webhookEvent": "MobileDeviceUnEnrolled"
  },
  "event": {
    "udid": "",
    "deviceName": "",
    "version": "",
    "model": "",
    "bluetoothMacAddress": "",
    "wifiMacAddress": "",
    "imei": "",
    "icciID": "",
    "product": null,
    "serialNumber": "",
    "userDirectoryID": "-1",
    "room": "",
    "osVersion": "",
    "osBuild": "",
    "modelDisplay": "",
    "username": "",
    "jssID": 1
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>13</id>
        <name>MobileDeviceUnEnrolled Webhook</name>
        <webhookEvent>MobileDeviceUnEnrolled</webhookEvent>
    </webhook>
    <eventObject>
        <udid></udid>
        <deviceName></deviceName>
        <version></version>
        <model></model>
        <bluetoothMacAddress></bluetoothMacAddress>
        <wifiMacAddress></wifiMacAddress>
        <imei/>
        <icciID/>
        <product/>
        <serialNumber></serialNumber>
        <userDirectoryID>-1</userDirectoryID>
        <room/>
        <osVersion></osVersion>
        <osBuild></osBuild>
        <modelDisplay></modelDisplay>
        <username/>
        <jssID>1</jssID>
    </eventObject>
</JSSEvent>

PatchSoftwareTitleUpdated

An update to a software title that has been subscribed to in the JSS is available.
JSON Example
{
  "webhook": {
    "id": 14,
    "name": "PatchSoftwareTitleUpdated Webhook",
    "webhookEvent": "PatchSoftwareTitleUpdated"
  },
  "event": {
    "name": "",
    "latestVersion": "",
    "lastUpdate": 1463054400000,
    "reportUrl": "",
    "jssID": 1
  }
} 
XML Example
<JSSEvent>
    <webhook>
        <id>14</id>
        <name>PatchSoftwareTitleUpdated Webhook</name>
        <webhookEvent>PatchSoftwareTitleUpdated</webhookEvent>
    </webhook>
    <eventObject>
        <name></name>
        <latestVersion></latestVersion>
        <lastUpdate>1462968000000</lastUpdate>
        <reportUrl></reportUrl>
        <jssID></jssID>
    </eventObject>
</JSSEvent> 

PushSent

An MDM command has been sent to a computer from the JSS.
JSON Example
 {
  "webhook": {
    "id": 15,
    "name": "PushSent Webhook",
    "webhookEvent": "PushSent"
  },
  "event": {
    "type": "",
    "jssID": 1
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>15</id>
        <name>PushSent Webhook</name>
        <webhookEvent>PushSent</webhookEvent>
    </webhook>
    <eventObject>
        <type></type>
        <jssID></jssID>
    </eventObject>
</JSSEvent> 

RestAPIOperation

A REST API request has been performed on the JSS.

objectID: ID of the JSS object

objectName: Name of the JSS object

objectTypeName: What type of JSS object was interacted with 

authorizedUsername: The user who authenticated for the REST request

restAPIOperationType: Will be GET, POST, PUT or DELETE

JSON Example
 {
  "webhook": {
    "id": 16,
    "name": "RestAPIOperation Webhook",
    "webhookEvent": "RestAPIOperation"
  },
  "event": {
    "operationSuccessful": true,
    "objectID": 1,
    "objectName": "",
    "objectTypeName": "",
    "authorizedUsername": "",
    "restAPIOperationType": ""
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>16</id>
        <name>RestAPIOperation Webhook</name>
        <webhookEvent>RestAPIOperation</webhookEvent>
    </webhook>
    <eventObject>
        <operationSuccessful>true</operationSuccessful>
        <objectID>1</objectID>
        <objectName/>
        <objectTypeName></objectTypeName>
        <authorizedUsername></authorizedUsername>
        <restAPIOperationType></restAPIOperationType>
    </eventObject>
</JSSEvent>

SCEPChallenge

A SCEP challenge (issued during MDM enrollments) has been made by the JSS.
JSON Example
{
  "webhook": {
    "id": 17,
    "name": "SCEPChallenge Webhook",
    "webhookEvent": "SCEPChallenge"
  },
  "event": {
    "targetDevice": ''
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>17</id>
        <name>SCEPChallenge Webhook</name>
        <webhookEvent>SCEPChallenge</webhookEvent>
    </webhook>
    <eventObject>
        <targetDevice></targetDevice>
    </eventObject>
</JSSEvent> 

SmartGroupComputerMembershipChange

Membership of a smart mobile device group in the JSS has changed.

Event Type: Smart Group

'computer' attribute is 'true'

JSON Example
{
  "webhook": {
    "id": 18,
    "name": "SmartGroupMobileDeviceMembershipChange Webhook",
    "webhookEvent": "SmartGroupMobileDeviceMembershipChange"
  },
  "event": {
    "name": "",
    "smartGroup": true,
    "jssid": 1,
    "computer": true
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>18</id>
        <name>SmartGroupMobileDeviceMembershipChange</name>
        <webhookEvent>SmartGroupMobileDeviceMembershipChange</webhookEvent>
    </webhook>
    <eventObject>
        <name></name>
        <smartGroup>true</smartGroup>
        <jssid>1</jssid>
        <computer>true</computer>
    </eventObject>
</JSSEvent>

SmartGroupMobileDeviceMembershipChange

Membership of a smart mobile device group in the JSS has changed.

Event Type: Smart Group

'computer' attribute is 'false'


JSON Example
{
  "webhook": {
    "id": 19,
    "name": "SmartGroupMobileDeviceMembershipChange Webhook",
    "webhookEvent": "SmartGroupMobileDeviceMembershipChange"
  },
  "event": {
    "name": "",
    "smartGroup": true,
    "jssid": 1,
    "computer": false
  }
}
XML Example
<JSSEvent>
    <webhook>
        <id>19</id>
        <name>SmartGroupMobileDeviceMembershipChange</name>
        <webhookEvent>SmartGroupMobileDeviceMembershipChange</webhookEvent>
    </webhook>
    <eventObject>
        <name></name>
        <smartGroup>true</smartGroup>
        <jssid>1</jssid>
        <computer>false</computer>
    </eventObject>
</JSSEvent>
  • No labels

2 Comments

  1. Anonymous

    MobileDeviceEnrolled json example has event = "webhookEvent": "MobileDeviceCheckIn"

    Copypasta error or Product Issue? 

    Thanks Bryson. 

    1. Big copy & paste error. I did it on all the samples. They've been updated. Thanks!

Write a comment…