View and group sessions
You can view and group sessions using the REST API.
Overview
To work with sessions using the REST API, you must be authenticated as the site admin. For details, see Authentication.
How to view and group sessions
Here are examples for viewing sessions.
View all sessions
GET .../admin/sessions
                                                        
Response:
{
  "total_count": 3,
  "data": [
    {
      "type": "session",
      "creation_time": "2018-08-09T08:14:24Z",
      "access_type": "USER_API_ACCESS",
      "shared_space": {
        "type": "shared_space",
        "name": "Default Isolated Space",
        "id": "1001",
        "version": "12.60.14"
      },
      "license_edition": null,
      "end_time": null,
      "client_ip": "10.244.0.0",
      "id": "1001",
      "client_type": "CI_CLIENT",
      "user": {
        "type": "site_user",
        "activity_level": 0,
        "uid": "1",
        "full_name": "TheAdmin@TheCompany.com",
        "name": "TheAdmin@TheCompany.com",
        "phone2": null,
        "phone3": null,
        "last_name": "TheAdmin@TheCompany.com",
        "language": "lang.en",
        "id": "1001",
        "first_name": "TheAdmin@TheCompany.com",
        "email": "TheAdmin@TheCompany.com",
        "phone1": "000"
      }
    },
    {
      "type": "session",
      "creation_time": "2018-08-09T08:21:02Z",
      "shared_space": null,
      "access_type": "USER_API_ACCESS",
      "license_edition": null,
      "end_time": null,
      "client_ip": "10.244.0.0",
      "id": "1002",
      "client_type": "PUBLIC_API",
      "user": {
        "type": "site_user",
        "activity_level": 0,
        "uid": "1",
        "full_name": "TheAdmin@TheCompany.com",
        "name": "TheAdmin@TheCompany.com",
        "phone2": null,
        "phone3": null,
        "last_name": "TheAdmin@TheCompany.com",
        "language": "lang.en",
        "id": "1001",
        "first_name": "TheAdmin@TheCompany.com",
        "email": "TheAdmin@TheCompany.com",
        "phone1": "000"
      }
    },
    {
      "type": "session",
      "creation_time": "2018-08-09T08:26:33Z",
      "shared_space": null,
      "access_type": "USER_UI_ACCESS",
      "license_edition": null,
      "end_time": null,
      "client_ip": "10.244.0.0",
      "id": "1003",
      "client_type": "MQM_UI",
      "user": {
        "type": "site_user",
        "activity_level": 0,
        "uid": "1",
        "full_name": "TheAdmin@TheCompany.com",
        "name": "TheAdmin@TheCompany.com",
        "phone2": null,
        "phone3": null,
        "last_name": "TheAdmin@TheCompany.com",
        "language": "lang.en",
        "id": "1001",
        "first_name": "TheAdmin@TheCompany.com",
        "email": "TheAdmin@TheCompany.com",
        "phone1": "000"
      }
    },
    
    },
  ],
  "exceeds_total_count": false
}
                                                        View sessions grouped by users
GET .../admin/sessions/groups?group_by=user
                                                        
Response:
{
  "groups": [
    {
      "count": 5,
      "value": {
        "type": "site_user",
        "activity_level": 0,
        "uid": "1",
        "full_name": "AdminUser@TheCompany",
        "phone2": null,
        "name": "AdminUser@TheCompany",
        "phone3": null,
        "last_name": "AdminUser@TheCompany",
        "language": "lang.en",
        "id": "1001",
        "first_name": "AdminUser@TheCompany",
        "email": "AdminUser@TheCompany",
        "phone1": "000"
      },
      "aggregatedData": {},
      "groups": null
    },
    {
      "count": 2,
      "value": {
        "type": "site_user",
        "activity_level": 0,
        "uid": "UIDString1",
        "full_name": "admin@TheCompany.com Java Automation",
        "phone2": null,
        "name": "admin@TheCompany.com",
        "phone3": null,
        "last_name": "Java Automation",
        "language": "lang.en",
        "id": "2001",
        "first_name": "admin@TheCompany.com",
        "email": "admin@TheCompany.com",
        "phone1": "1234567890"
      },
      "aggregatedData": {},
      "groups": null
    },
    {
      "count": 3,
      "value": {
        "type": "site_user",
        "activity_level": 0,
        "uid": "UIDString2",
        "full_name": "PreFlightSanity@TheCompany.com Java Automation",
        "phone2": null,
        "name": "PreFlightSanity@TheCompany.com",
        "phone3": null,
        "last_name": "Java Automation",
        "language": "lang.en",
        "id": "2003",
        "first_name": "PreFlightSanity@TheCompany.com",
        "email": "PreFlightSanity@TheCompany.com",
        "phone1": "1234567890"
      },
      "aggregatedData": {},
      "groups": null
    },
    {
      "count": 4,
      "value": {
        "type": "site_user",
        "activity_level": 0,
        "uid": "UIDString3",
        "full_name": "PostFlightSanity@TheCompany.com Java Automation",
        "phone2": null,
        "name": "PostFlightSanity@TheCompany.com",
        "phone3": null,
        "last_name": "Java Automation",
        "language": "lang.en",
        "id": "3001",
        "first_name": "PostFlightSanity@TheCompany.com",
        "email": "PostFlightSanity@TheCompany.com",
        "phone1": "1234567890"
      },
      "aggregatedData": {},
      "groups": null
    }
  ],
  "groupsTotalCount": 4
}
                                                        View sessions grouped by space
If the value returned is null, the session was opened either by automation or the site admin.
GET .../admin/sessions/groups?group_by=shared_space
                                                        
Response:
{  "groups":   [       {"count":7,
"value":
                {"type":"shared_space",
"name":"Default Isolated Space",
"id":"1001","version":"12.60.14"
},
           "aggregatedData":{},"groups":null
},
        {"count":7,
"value":null,
           "aggregatedData":{},"groups":null
}
],
"groupsTotalCount":2 }
                                                            
 See also: 

                                                        
                                                        
                                                        
                                                        
                                                        
 
                                                                    
                                                                    
                                        
                                        