cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Creating additional applications that can help businesses make decisions using the Cisco CMX API

462
Views
0
Helpful
0
Comments
Cisco Employee

This article will consider the options for using the CMX API to solve business tasks and also some features of using JSON data obtained from CMX.


Thanks to the Cisco CMX solutions, Wi-Fi, as an usual network access tool, can turn into a powerful analytics one, stimulate buyers’ interest, and generate additional profits.

Due to the widespread use of smartphones and tablets, as well as general informatization of society, Wi-Fi networks covered enormous areas of premises and streets by moving from preferred category to mandatory one.


To start with, Cisco has two CMX-related products (services): CMX Location & Analytics and CMX Presence. Each product has the appropriate licenses, the cost of which depends on the number of connected access points.


As a business owner or organizer, you can encourage your visitors to connect to Wi-Fi and thereby getting more accurate information about your visitors and for business decision making.

These options may include:

- Establish correlations (based on data that can be obtained from CMX);

- Forecast the number of visitors (using data about devices that were connected to and/or in relevant locations).


Calculating and establishing correlations will help you understand on which day of the week most visitors come, and you can adapt your business processes accordingly. With regard to correlations themselves, one can establish dependencies on the number of connections from the day of the week. To do this, you can take average values for previous weeks.

    response = requests.post(

        url=base_url + f'api/analytics/v1/{api_endpoint.get(label)}',

        auth=requests.auth.HTTPBasicAuth(

            settings.SERVER_LOGIN,

            settings.SERVER_PASSWORD

        ),

        headers={

            'Content-type': 'application/json'

        },

        data=json.dumps({

            "period": f"{start_response_period};{end_response_period}",

            "timeRange": "00:00-23:59",

            "granularity": "daily",

            "durationCategories": "0-1440",

            "aggregate": "avg",

            "includeStationary": True,

            "connectionState": "connected",

            "expandAll": False

        }),

        verify=False

    )

Requst sample

visitors_correlation.png

Visualization of correlations

If these data are available to owners / managers of bookstores or clothing shops, they will be able to mobilize staff at the right time, place additional direction signs and optimize aisles, etc.


The next correlation uses the dependence of the dwell time on the week day or the daytime. This dependence can be useful to business, indicating how long the visitors stayed in premises or how active they did shopping. The last correlation can indicate how successful a particular event was, how many visitors left the premises some time before the close of the event, how many of them remained until the end, and the number of visitors who had previously visited the premises or a conference room.

dwell_time_correlation.png

Dwell time correlation

All these advantages will allow business to pay more attention to their customers and make good impression of its company/brand on them.


The models that forecast the number of visitors will allow you to predict a different number of visitors and be prepared for corresponding alternatives.


In particular, the following forecasting models which use data were applied in my work.

forecast_number_of_visitors.png

Forecast number of visitors

The image shows the forecast of the number of visitors for two weeks. We can see that the model considers weekends with fewer visitors for previous periods of time.


The data from following request with the CMX API was used for prediction:

    response = requests.post(

        url=base_url + f'api/analytics/v1/deviceCount',

        auth=requests.auth.HTTPBasicAuth(settings.SERVER_LOGIN,

                                         settings.SERVER_PASSWORD

                                         ),

        headers={

            'Content-type': 'application/json'

        },

        data=json.dumps(

            {

                "period": f"{start_date};{end_date}",

                "timeRange": "00:00-23:59",

                "granularity": "daily",

                "durationCategories": "0-1440",

                "aggregate": None,

                "includeStationary": False,

                "connectionState": "connected",

                "expandAll": False

            }

        ),

        verify=False

    )

You can also enter data about state and religious holidays in the forecasting model. During religious holidays, if you are an entertaining institution, it is natural that the number of your visitors will be reduced.  If we consider church, cathedrals or mosques, then the number of people there, as well as the corresponding load on the network infrastructure will be sharply increased.

device.jpg

Knowing the load on the network infrastructure, you can configure the wireless lan controller (WLC) settings, connect additional access points and possibly buy more equipment to increase sales.

Features of data usage


To use CMX Presense, you will need such an indicator as SiteID

You can find it using GET request cmx_server_url + api/config/v1/sites

[

    {

        "changedOn": 0,

        "aesUId": 1496158540357,

        "name": "Learning",

        "description": null,

        "aps": [],

        "rssiThresholdLow": -95,

          ...

     }

...

]

JSON response

The aesUId parameter is SiteID itself that can often be found for other requests.

Then, substituting the SiteID parameter for the corresponding requests, you can receive the necessary information

For example, such a request

api/presence/v1/passerby/count/3days?siteId=<SiteID>

is transformed for our website into

api/presence/v1/passerby/count/3days?siteId=1496158540357

An attention should also be paid to the following format of values in the CMX 10.3 software:

There is such a parameter as changedOn

This parameter is responsible for the time when a certain device was located within certain coordinates.

For example, if we convert the UNIX time number 1519384400350, we will receive the date and time 05/17/50117 @ 2:19pm (UTC), which is obviously in the far future. For the relevant conversion, it is necessary to remove the last three digits from the line, then 1519384400 will be converted to the actual date 02/23/2018 @ 11:13am (UTC).


Link to documentation: Rest API Guide, Release 10.3

More about CMX and sandbox for testing


If you have your own interesting cases of the CMX API use for business purposes, please, share them in the comments. If you have questions, comments or suggestions, you can contact us at balexey@cisco.com

CreatePlease to create content
This widget could not be displayed.