How to retrieve data related to connection

Connection represents an initial connection or reconnect for a session. Use Citrix Monitor Service API to get the details of connection.

Prerequisites

Connection details for sessions with failure

  • Use $expand operation to get the details for sessions with failure.

Request

/monitorodata/Connections?$filter=Session/FailureDate ge 2024-07-24T00:00:00.000Z and Session/FailureDate le 2024-07-25T00:00:00.000Z &$select=*,&$expand=Session($select=*;$expand=User($select=UPN,UserName),Failure($select=ConnectionFailureEnumValue,Category),Machine($select=DnsName,DesktopGroupId,IsInMaintenanceMode)) 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#Connections(*,Session(*,User(Upn,UserName),Failure(ConnectionFailureEnumValue,Category),Machine(DnsName,DesktopGroupId,IsInMaintenanceMode)))",
    "value": [
        {
            "Id": 408601,
            "ClientName": "test_s_MacBook_Pr",
            "ClientAddress": "192.168.50.144",
            "ClientVersion": "22.01.0.9",
            "ClientPlatform": "Macintosh",
            "ConnectedViaHostName": null,
            "ConnectedViaIPAddress": "10.69.78.36",
            "LaunchedViaHostName": null,
            "LaunchedViaIPAddress": null,
            "IsReconnect": false,
            "IsSecureIca": false,
            "Protocol": "HDX",
            "LogOnStartDate": "2022-03-31T07:49:47.307Z",
            "LogOnEndDate": "2022-03-31T07:50:00.33Z",
            "BrokeringDuration": null,
            "BrokeringDate": null,
            "DisconnectCode": 0,
            "DisconnectDate": "2022-03-31T08:10:51.533Z",
            "VMStartStartDate": null,
            "VMPoweredOnDate": null,
            "VMStartEndDate": null,
            "ClientSessionValidateDate": null,
            "ServerSessionValidateDate": "2022-03-31T07:49:47.307Z",
            "EstablishmentDate": "2022-03-31T07:49:47.307Z",
            "HdxStartDate": null,
            "HdxEndDate": null,
            "AuthenticationDuration": null,
            "GpoStartDate": null,
            "GpoEndDate": null,
            "LogOnScriptsStartDate": null,
            "LogOnScriptsEndDate": null,
            "ProfileLoadStartDate": null,
            "ProfileLoadEndDate": null,
            "InteractiveStartDate": null,
            "InteractiveEndDate": null,
            "SessionKey": "38502302-78ed-4f02-a3f0-cf6a31269b29",
            "CreatedDate": "2022-03-31T07:50:00.33Z",
            "ModifiedDate": "2022-03-31T08:10:51.533Z",
            "Session": {
                "SessionKey": "38502302-78ed-4f02-a3f0-cf6a31269b29",
                "StartDate": "2022-03-31T07:49:47.307Z",
                "LogOnDuration": null,
                "EndDate": null,
                "ExitCode": 1,
                "FailureId": 13,
                "FailureDate": "2024-07-24T14:53:56.517Z",
                "ConnectionState": 2,
                "SessionIdleTime": null,
                "ConnectionStateChangeDate": "2022-04-22T07:47:14.63Z",
                "LifecycleState": 0,
                "CurrentConnectionId": 884385,
                "UserId": 1505,
                "MachineId": "7ff93079-914a-4e6e-b9fe-5ce6e7578684",
                "SessionType": 0,
                "IsAnonymous": false,
                "PublishedDesktopId": null,
                "CreatedDate": "2022-03-31T07:50:00.33Z",
                "ModifiedDate": "2022-04-22T07:47:14.63Z",
                "User": {
                    "Upn": "test.test@citrix.com",
                    "UserName": "test"
                },
                "Failure": {
                    "ConnectionFailureEnumValue": 101,
                    "Category": 2
                },
                "Machine": {
                    "DnsName": "test-office.eng.citrite.net",
                    "IsInMaintenanceMode": false,
                    "DesktopGroupId": "b62f4949-0756-4a1e-94d9-e70cdfd0a198"
                }
            }
        }
    ]
}
<!--NeedCopy-->
Resources
Citrix Monitor Service API OpenAPI Specification
Copy Download
How to retrieve data related to connection