REST API - GET Session Details

Updated

This operation returns a list of sessions for a user. The API applies to all Commvault consoles, all mobile applications, and the command line interface.

To return sessions for users other than the user currently logged on, you must be assigned a role that includes the Add, Delete and Modify a User permission. For information about roles, see Roles Overview.

Request

Syntax

GET <webservice>/Session?userId={userId} HTTP/1.1
 Host: <host name>
 Accept: application/xml
 Authtoken: <authentication token>
    

where <webservice> is the root path used to route the API requests to the Web Server.

For more information, see Available Web Services for REST API.

Request Parameters

Name

Description

Required

userId

The user ID for the user. If the user ID is not known, use the GET User API to retrieve it.

Yes

Request Headers

Name

Description

Host

The host name of the Web Server or Web Console used in the API request.

Accept

The format of the response. Valid values are: application/xml or application/json.

Authtoken

The authentication token received after successfully logging on. For details on receiving an authentication token, see Authentication.

Response

Response Parameters

Parameter

Description

Element

logoutTime

The time the user logged off.

Valid values are:

  • 0, if the user did not log off

  • UNIX-style timestamps (seconds since January 1, 1970)

sessions

loginTime

The time the user logged on.

Valid values are UNIX-style timestamps (seconds since January 1, 1970).

sessions

host

The host name of the machine where the user is logged on.

sessions

sessionId

The system-generated ID assigned to the session.

sessions

browserSessionId

The system-generated ID assigned to the browser session.

sessions

consoleType

Where the user is logged on.

Valid values are:

  • 5, for the CommCell Console

  • 13, for the command line interface

  • 14, for the CommCell Console as a remote web-based application

  • 19, for the Web Console and mobile applications

sessions

userName

The name of the user.

user

userId

The system-generated ID assigned to the user.

user

Examples

Sample Request

GET <webservice>/Session?userId=10 HTTP/1.1
 Host: client.mydomain.com
 Accept: application/xml
 Authtoken: QSDK 38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc6
 0f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f
 8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f
 40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef7
 68fda78183a4208930954a377f66eb56c8b92cexampl4s437a19317ca6ce7f323
 3d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8
    

Sample Response

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
 <Api_GetLoggedInSessionsResp>
   <sessions logoutTime="1453394214" loginTime="1453328412" host="host002" description="" sessionId="EMCAE92D1DD-0C68-49A6-BEBB-404D96D7A4BF" browserSessionId="3" consoleType="5">
     <user userName="jsmith" userId="10" />
   </sessions>
 </Api_GetLoggedInSessionsResp>