Skip to content

Latest commit

 

History

History
130 lines (76 loc) · 6.14 KB

File metadata and controls

130 lines (76 loc) · 6.14 KB

Examples

The SDK comes with a few examples that you can look at to better understand how a workspace integration works:

This guide will walk through the steps necessary to get the examples up and running in a few minutes.

Common to all the examples are the following steps:

1. Write the integration manifest

When you create an integration you must provide a manifest that describes what your integration does, what developer API scopes, XAPI commands, events and statuses it needs access to.

You can create the manifest file yourself or use the visual editor.

Each of the examples have a corresponding manifest file under the resources/manifests directory.

2. Create a workspace integration in Control Hub

A workspace integration is created in the Control Hub Workspaces Integrations page using the manifest "Upload integration" option:

Select the manifest file to upload and store the returned OAuth Client ID and OAuth Client Secret:

The OAuth Client ID and secret will be used when you start the example.

3. Activate the integration

After the integration is created it must be activated on the integration details page:

The activation wizard provides an activation code (JWT):

You know have the three things you need:

  • OAuth client ID
  • OAuth client secret
  • Activation code

Let's move on to the examples...

Call satisfaction survey

This example displays a rating survey on the devices after a call disconnects using:

  1. The CallDisconnect event to detect when a call has ended,
  2. The UserInterface.Message.Rating.Display command to show a rating dialog on the device user interface and
  3. The UserInterface.Message.Rating.Response event to capture the rating.

Setup

  1. Upload the callsatisfactionsurvey.json manifest and capture the OAuth clientId, secret and activation code (JWT) as described above.
  2. Run the example providing the clientId and secrets as program arguments.
  3. The first time the example is run, you will need to provide the activation code as a command line input.

Run from IntelliJ

Run from IntelliJ

img.png

Run from command line

  1. Go to the root project directory and run mvn clean install -P callsatisfactionsurvey
  2. Start the example by running java -jar examples/target/callsatisfactionsurvey.jar <clientId> <clientSecret>

Room capacity monitor

This example displays a prompt on the device if the number of people detected by the device exceeds the capacity stored for the workspace in Control Hub.

  1. The RoomAnalytics.PeopleCount.Current status is used to track the people count,
  2. The Workspaces GET API is used to fetch the capacity,
  3. The UserInterface.Message.Alert.Display command shows an alert on the device.

Setup

  1. Upload the roomcapacitymonitor.json manifest and capture the OAuth clientId, secret and activation code (JWT) as described above.
  2. Run the example providing the clientId and secrets as program arguments.
  3. The first time the example is run, you will need to provide the activation code as a command line input.

Run from IntelliJ

Run from IntelliJ

img.png

Run from command line

  1. Go to the root project directory and run mvn clean install -P roomcapacitymonitor
  2. Start the example by running java -jar examples/target/roomcapacitymonitor.jar <clientId> <clientSecret>

Environmental sensor data

This example captures environmental sensor data from the devices:

  1. RoomAnalytics.AmbientTemperature
  2. RoomAnalytics.RelativeHumidity
  3. RoomAnalytics.AmbientNoise.Level.A

Setup

  1. Upload the environmentaldata.json manifest and capture the OAuth clientId, secret and activation code (JWT) as described above.
  2. Run the example providing the clientId and secrets as program arguments.
  3. The first time the example is run, you will need to provide the activation code as a command line input.

Run from IntelliJ

Run from IntelliJ

img.png

Run from command line

  1. Go to the root project directory and run mvn clean install -P environmentaldata
  2. Start the example by running java -jar examples/target/environmentaldata.jar <clientId> <clientSecret>

Gotchas

  1. Due to caching in the Webex cloud, it might take up to 60 minutes for all the devices in your organization to pick up on changes to your uploaded manifests. If you are testing with a specific device, then a reboot will speed up the process.
  2. Note that a workspace integration will (if nothing else is specified) get access to all workspaces and devices in your organization. To avoid causing problems when running the examples, we recommend to limit the integration access to a location with only the devices you want to test.