How to retrieve data related to user

Users represent the users that have launched a session in the site. Use Citrix Monitor Service API to get the details of users.

Prerequisites

Users of target domain

  • Domain eq 'CITRITE' represents the target domain.

Request

GET /monitorodata/Users?$filter=Domain eq 'CITRITE' HTTP/1.1
Host: api.cloud.com
Authorization: CWSAuth bearer=<Token>
Citrix-CustomerId: <CustomerId>
<!--NeedCopy-->

Response

HTTP/1.1 200 OK
Date: Thu, 01 Aug 2024 06:23:00 GMT
Content-Type: application/json; odata.metadata=minimal
Content-Length: 5506
Connection: keep-alive
odata-version: 4.0

{
    "@odata.context": "https://api.cloud.com/monitorodata/$metadata#Users",
    "value": [
        {
            "Id": 2,
            "Sid": "S-1-5-21-1076320343-3137401123-2908695819-83261",
            "Upn": "matthew.bennett@citrix.com",
            "UserName": "matthewben",
            "FullName": "Matthew Bennett",
            "Domain": "CITRITE",
            "CreatedDate": "2018-12-12T11:30:57.15Z",
            "ModifiedDate": "2021-05-10T12:27:18.223Z"
        },
        {
            "Id": 3,
            "Sid": "S-1-5-21-1076320343-3137401123-2908695819-83263",
            "Upn": "adm1_matthewben@citrix.com",
            "UserName": "adm1_matthewben",
            "FullName": "Matthew Bennett (ADM1)",
            "Domain": "CITRITE",
            "CreatedDate": "2018-12-12T11:34:37.637Z",
            "ModifiedDate": "2021-07-26T15:36:01.04Z"
        }
    ]
}
<!--NeedCopy-->

Users with high logon duration

  • StartDate gt 2020-03-01 selects sessions started after the timestamp.
  • LogonDuration gt 20000 selects users with logon duration greater than 20 seconds.
  • $expand=Machine($select=Name;$expand=DesktopGroup($select=Name)) adds machine details.
  • User($select=FullName)&$select=StartDate,LogonDuration adds user details.
  • orderby=LogOnDuration desc sorts the results in descending order.

Request

GET /monitorodata/Sessions?$filter=StartDate gt 2020-03-01 and LogonDuration gt 20000 &$expand=Machine($select=Name;$expand=DesktopGroup($select=Name)),User($select=FullName)&$select=StartDate,LogonDuration&orderby=LogOnDuration desc HTTP/1.1
Host: api.cloud.com
Authorization: CWSAuth bearer=<Token>
Citrix-CustomerId: <CustomerId>
<!--NeedCopy-->

Response

HTTP/1.1 200 OK
Date: Thu, 01 Aug 2024 06:23:00 GMT
Content-Type: application/json; odata.metadata=minimal
Content-Length: 5506
Connection: keep-alive
odata-version: 4.0

{
    "@odata.context": "https://api.cloud.com/monitorodata/$metadata#Sessions(StartDate,LogOnDuration,Machine(Name,DesktopGroup(Name)),User(FullName))",
    "value": [
        {
            "StartDate": "2024-08-02T13:04:55.36Z",
            "LogOnDuration": 84904,
            "Machine": {
                "Name": "ENG\\ra-s19-cvad040",
                "DesktopGroup": {
                    "Name": "CVD\\BUR CVAD Development"
                }
            },
            "User": {
                "FullName": "AAA AAA Huang"
            }
        },
    ]
}
<!--NeedCopy-->
Resources
Citrix Monitor Service API OpenAPI Specification
Copy Download
How to retrieve data related to user