Showing results for 
Search instead for 
Did you mean: 

How to collect user first login time and last logout time through REST API's


I am planning to build an attendance system using cisco CMX cloud REST API's(Presence analytics ).

Basically, I need first login time and last exit time (every day) of  all the mobile devices which are connected to WIFI.

Please suggest the better way to achive this.

Frequent Contributor


are you using the connect api?

please, let us know more details of your use case.



Dear Matthew

My use case is simple.

I want to build for time attendance application. For that, I need to pull the data from CMX cloud Data(considering all the users connected to wifi).

So I need a CMX API which should return the first login and last exit time of all the users(every day) connected to particular Access point or controller.

So that I can use this API to build the time attendance system.

Frequent Contributor


Please, see the under Connect resource. 

Login to Cisco CMX Cloud from Chrome browser, then open another tab and enter https://<tenant_id> with various search criteria.

Hope this is the resource you are looking for,


Dear Matthew

No.. This is not correct.

Let me give a sample use.

I want to know all employees entry and exit time in my office like a time attendance system.

(assume all of them connected to wifi of particular site).

I need to know the first entry timestamp  (means when a particular mobile device of employee connected to wifi first time for a day ) and last exit timestamp of the day.

Please share me your contact details.

Frequent Contributor


The Presence API returns counts, averages, sums, etc. where the Connect API will return a query of user session data based on criteria such as MAC addresses, last session time, status, and any or all fields.  Cisco Connected Mobile Experiences Cloud REST API Guide - Connect [Cisco Connected Mobile Experiences (CMX) Cloud] - Ci…

A custom portal can be used to request registration information from the sign-in page, and can be used as data source for your reports.  Information such as Name, Email, Phone, Social Auth is captured.

Here is an example of the Connect API resource.



  "returnRecordCount": 1,

  "records": [{

  "agent": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36",

  "Email": "",

  "language": "English",

  "bytesSent": 0,

  "type": "CustomPortal",

  "ssid": "null",

  "operatingSystem": "Intel Mac OS X 10",

  "Name": "matthewjfarrell",

  "lastLoginTime": "Jun 2, 2017 4:01:08 PM, UTC",

  "lastLogoutTime": "Jun 2, 2017 4:01:08 PM, UTC",

  "macAddress": "null",

  "bytesReceived": 0,

  "firstLoginTime": "Jun 2, 2017 3:56:17 PM, UTC",

  "clientIp": null,

  "location\/Site": "Global",

  "state": "active",

  "authType": "REGISTRATION",

  "portal": "CMX Presence",

  "device": "Macintosh",

  "lastAcceptTime": "Jun 2, 2017 4:01:08 PM, UTC"


  "timeZoneOffset": 0,

  "queryRecordCount": 1000,

  "timeZone": "Coordinated Universal Time",

  "nextIndex": 1000


Let us know if you have any questions,


Frequent Contributor


You can also download a CVS of Visitor Search to get all the fields, such as Social login data.

From Connect & Engage, choose "Export all Visitors".

Let us know if you are road blocked or have questions.


Dear Matthew

My requirement is simple

I need first login time of the users every day(connect and encage module ).

Currently its giving only first login for whole which means its giving the very first time when the device connected to wifi. But I need first login time every day.

Based on the call with your support team it’s not possible with current api’s.

Let me know if there is any other options.



Frequent Contributor


I understand the issue now, the first login time per session (start to end parameters) is missing.

I will open a CDETS ticket to request this enhancement.



Update:  Since CMX Cloud (currently deployed with only Presence Analytics) does not keep historical location data, an additional parameter is proposed dailyLoginTime to use for daily reports.  This parameter will be overwritten each day.



GET: Query User Sessions first login time per day is needed for customer use case.


The /api/connect/v1/clients REST API provides firstLoginTime (historical), lastLoginTime (updated on each login).  The first login time per day is needed to determine daily presence at a place or event.

The Connect API is the appropriate resource to use to pull employees/students entry and exit time from office/classroom, like a time attendance system.  However, this will require a new parameter dailyLoginTime for first login time of each day (occurring every day or every weekday).  Currently firstLoginTime is the first time the device is connected.  With this new parameter dailyLoginTime the customer can use the Connect API for daily reports of all the mobile devices which are connected to WIFI.

Hello Matthew,

I would like to know if you have any answer about this issue.

I am trying to get user information from Daily Login Time, but without success.

Do know another string to get it? else?)



Frequent Contributor


Checking the CDETS ticket opened, this was ignored at the time. Possibly an enhancement has been made since that time, though.  Here is the developer's comment:

Connect DB doesn't maintain client history. To meet the new requirement, it's a major effort and DB size will increase dramatically. There's no plan for such big change as of now.
Fortunately, there are 3 workarounds:

  1. customer query connect API and do filtering on lastLoginIn & lastLogout timestamp daily. This way, customer will get client stay with WiFi duration in last 24 hours
  2. customer subscribe notification of client association and disassociation event.
  3. customer query location API and get more client history information with location API as below. A given mac with given date, it can show how long this client present at a venue by sorting chgOn (last time stamp - first time stamp):



Beside API calls, you can use Prime "session reports" which records data you are after.

Content for Community-Ad

This widget could not be displayed.