Back to top

Knox Webhook Notification for Knox Guard

Last updated October 15th, 2024

The following tutorials will help you get started on using the Knox Webhook Notification API for Knox Guard.

Currently, the Knox Webhook Notification API supports the following Knox Guard events:

Device relock timestamping is only applicable for the Knox Guard Pay-As-You-Go (PAYG) plan.

Knox Webhook Notification sends change notifications when these events are complete.

Prerequisites

Samsung Knox account and authentication token

Before you start using Knox Webhook Notification API for Knox Guard, ensure that you:

  1. Create a Samsung Knox account.

  2. Have access to the Knox Cloud API as a developer.

  3. Set up your authentication token to make API calls to the Knox cloud service APIs.

To complete these steps, see Knox Cloud API Authentication tutorial for customers.

Certificate

The Samsung Knox validation certificate is required to validate the response you’ll receive from Knox Webhook Notification. Download the certificate using the GET /downloadCertificate operation.

Alternatively, you can download the certificate by clicking the following button.

Download certificate

Use the Knox Webhook Notification API

Device enrollment

This tutorial demonstrates how you can use Knox Webhook Notification to call the Knox Guard device enrollment event and register it with Knox Webhook Notification to receive change notifications when the enrollment is complete.

Step 1: Subscribe an event

  1. Subscribe a particular event to Knox Webhook Notification through the Create Subscription operation — POST /kwn/v1/subscriptions.
  2. Provide a subscription URL — known as a “callback” — that you’ll register to receive asynchronous API operation results once the event is complete.
  3. Register the KG_DEVICE_ENROLLED event to asynchronously receive the API operation result on the device enrollment operation once it’s complete.

Step 2: Upload a device

Upload and enroll a device. Doing so makes an API call to the Knox Guard device enrollment operation.

Step 3: Handle response message

Once the device is successfully enrolled, you’ll receive the following message in the body of the subscribed URL call, as the response payload:

Device relock timestamping

Device relock timestamping is only applicable for the Knox Guard Pay-As-You-Go plan.

This tutorial demonstrates how you can use Knox Webhook Notification to call the Knox Guard device relock timestamping event and register it with Knox Webhook Notification to receive change notifications when the relock timestamp is applied to the device.

Step 1: Subscribe an event

  1. Subscribe a particular event to Knox Webhook Notification through the Create Subscription operation — POST /kwn/v1/subscriptions.

  2. Provide a subscription URL — known as “callback” — that you’ll register to receive asynchronous API operation results or event triggers once the event is complete.

  3. Register the KG_DEVICE_RELOCK_TIMESTAMP_APPLIED event to asynchronously receive information on the timestamping operation once it’s complete.

Step 2: Update relock timestamp

Update the relock timestamp to the device. Doing so makes an API call to the Knox Guard device relock timestamping operation.

Step 3: Handle response message

After Knox Guard finishes executing the requested operation — relock timestamping — you’ll receive the following message in the body of the subscribed URL call, as the response payload:

Lock a device

This tutorial demonstrates how you can use Knox Webhook Notification to call the Knox Guard device lock event and register it with Knox Webhook Notification to receive change notifications when an enrolled device is locked.

Step 1: Subscribe an event

  1. Subscribe a particular event to Knox Webhook Notification through the Create Subscription operation — POST /kwn/v1/subscriptions.

  2. Provide a subscription URL — known as a “callback” — that you’ll register to receive asynchronous API operation results once the event is complete.

  3. Register the KG_DEVICE_LOCKED event to asynchronously receive the API operation result from the device lock operation once it’s complete.

Step 2: Lock a device

Lock an enrolled device. Doing so makes an API call to the Knox Guard device lock operation.

Step 3: Handle response message

Once the enrolled device is successfully locked, you’ll receive the following message in the body of the subscribed URL call, as the response payload:

Unlock a device

This tutorial demonstrates how you can use Knox Webhook Notification to call the Knox Guard device unlock event and register it with Knox Webhook Notification to receive change notifications when a locked device is unlocked.

Step 1: Subscribe an event

  1. Subscribe a particular event to Knox Webhook Notification through the Create Subscription operation — POST /kwn/v1/subscriptions.

  2. Provide a subscription URL — known as a “callback” — that you’ll register to receive asynchronous API operation results once the event is complete.

  3. Register the KG_DEVICE_UNLOCKED event to asynchronously receive the API operation result from the device unlock operation once it’s complete.

Step 2: Unlock a device

Unlock a locked device. Doing so makes an API call to the Knox Guard device unlock operation, which unlocks the locked device and transitions it back to the normal state (Active).

Step 3: Handle response message

Once the locked device is successfully unlocked, you’ll receive the following message in the body of the subscribed URL call, as the response payload:

Verify the response

To verify the Knox Webhook Notification callback response:

  1. Get the String value of HttpRequestPayload
  1. Parse the encoded JoseHeader and signature from X-WSM-SIGNATURE
  1. Prepare the data to verify: DataToVerify = encodedJoseHeader.Base64UrlEncode(HttpRequestPayload)
  1. Decode the signature with Base64Url decoder and verify the data above by using SHA256withRSA
    • verify(DataToVerify, Base64UrlDecode(Signature))

Complete code

One URL for multiple subscriptions

As a customer, you can configure one URL to subscribe to multiple events, as follows:

  1. Use customerA to create the subscription using the Knox Webhook Notification Subscription API.
  2. Configure example.com/kwn_result/customerA as the callback URL.
  3. Make a call to one or more supported events using the same callback URL.

Once you successfully complete these steps, the configured URL example.com/kwn_result/customerA will receive the operation result.

Is this page helpful?