Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

WebSocket API Overview

You can use WebSockets in your Juniper Mist network. The WebSocket protocol can open a bidirectional communication session between a client and a server. You can send messages to the server and receive real-time, event-driven responses without having to poll the server for a reply.

The initial client request and server response use the HTTP protocol to establish the WebSocket communication. From then on, the client can subscribe to one or more topics (streaming channels) to stream data.

You and other administrators can use WebSockets in very specific use cases, such as data visualization dashboards or maps that must reflect real-time data values.

Examples

  • Populate a custom dashboard with the live status of Juniper Mist access points (APs) and real-time location data of Bluetooth Low Energy (BLE) assets.

  • Stream device data and statistics (such as transmit and receive packets) on an hourly basis to an external, operational dashboard like Grafana. Although the device statistics are robust, you can easily parse them to abstract the desired data for display.

WebSocket API Endpoint

The API endpoint depends on the global region that your organization is associated with. See API Endpoints and Global Regions .

Authentication Options

Juniper Mist requires authentication to establish a connection to the WebSocket API. You can use these methods:

WebSocket Streaming Channels

After Juniper Mist establishes a streaming connection with a client, the client needs to subscribe to at least one channel to send and receive messages. Messages go back and forth via the bidirectional WebSocket protocol. To stop sending and receiving messages from a channel, you can unsubscribe from it.

Note:

All channels require that you specify the site ID. To find a site ID in the Juniper Mist portal, select Organization > Site Configuration from the left menu, and then click the site.

Once you are logged in, you can view further information on each WebSocket.

Note:

Your documentation link will depend on the region (cloud) you have logged in to.

Table 1: WebSocket Documentation
Names Streaming Channels Documentation
Discovery of BLE Assets /sites/:site_id/stats/maps/:map_id/discovered_assets https://api.mist.com/api/v1/docs/Site#assets
BLE Asset Location /sites/:site_id/stats/maps/:map_id/assets https://api.mist.com/api/v1/docs/Site#assets
BLE Asset RF Glass Info /sites/:site_id/assets/:asset_id/diag https://api.mist.com/api/v1/docs/Site#location
SDK Client Location /sites/:site_id/stats/maps/:map_id/sdkclients https://api.mist.com/api/v1/docs/Site#location
SDK Client RF Glass Info /sites/:site_id/sdkclients/:sdkclient_id/diag https://api.mist.com/api/v1/docs/Site#location
Wi-Fi (Client Location /sites/:site_id/stats/maps/:map_id/clients https://api.mist.com/api/v1/docs/Site#client-stats
Wi-Fi Client Stats /sites/:site_id/stats/clients https://api.mist.com/api/v1/docs/Site#client-stats
Wi-Fi Client RF Glass Info /sites/:site_id/clients/:client_mac/diag https://api.mist.com/api/v1/docs/Site#location
Unconnected Clients /sites/:site_id/stats/maps/:map_id/unconnected_clients https://api.mist.com/api/v1/docs/Site#location
Devices /sites/:site_id/devices https://api.mist.com/api/v1/docs/Site#device
Device Stats /sites/:site_id/stats/devices https://api.mist.com/api/v1/docs/Site#device
Commands from Devices /sites/:site_id/devices/:device_id/cmd https://api.mist.com/api/v1/docs/Site#device
Streaming PCAP /sites/:site_id/pcaps https://api.mist.com/api/v1/docs/Site#subscribe-to-streaming-pcap