Session History API

Retrieves a specific user's session history with pagination and sorting. The userID parameter is required; others are optional. Returns a 200 response with session data and pagination details, or 400/404/500 on error.

Table 1. GET /ondemand/api/sessionHistory
Property Description
Summary Get session history.
Description Retrieves paginated session records for a specific user. Defaults to page 1 with 10 records, sorted by request time (descending).
Query Parameters
userID (String, Required)
The email or ID of the requesting user.
sortField (String, Optional)
Field to sort by (sessionKey, computerName, requestTime, etc.).
sortType (String, Optional)
Sort direction (ASC or DESC).
rows (Integer, Optional)
Records per page (Default: 10).
page (Integer, Optional)
Page number (Default: 1).
Responses
  • 200 OK: Session history retrieved successfully. For example -
    {
      "sessions": [
        {
          "sessionKey": 3456,
          "computerName": "PRO-DEV-LAPTOP-04",
          "description": "Remote support session",
          "requestTime": "2026-02-24T09:10:00Z",
          "startTime": "2026-02-24T09:15:00Z",
          "endTime": "2026-02-24T18:30:45Z",
          "registeredTarget": "target-01.example.com"
        },
        {
          "sessionKey": 3457,
          "computerName": "QA-SERVER-02",
          "description": "Diagnostics session",
          "requestTime": "2026-02-25T14:00:00Z",
          "startTime": "2026-02-25T14:05:00Z",
          "endTime": "2026-02-25T15:20:30Z",
          "registeredTarget": null
        }
      ],
      "page": 1,
      "size": 2,
      "totalRecords": 25
    }
    
  • 400 Bad Request: Missing userID.
  • 404 Not Found: User or target does not exist.
  • 500 Internal Server Error: Error retrieving records.