ConnectWise Control Software User Forum
»
Default
»
Advanced Customization
»
6.6 API - Is there a single call to get the online/offline status of all sessions?
 Rank: Guest Joined: 9/19/2018(UTC) Posts: 2  Location: UK
|
I am hoping to use one call to get all session information as opposed to just an individual call per session. At the moment I am polling each session guid individually and it's taking a while.
|
|
|
|
 Rank: Administration Medals:  Joined: 3/28/2014(UTC) Posts: 2,862  Thanks: 3 times Was thanked: 351 time(s) in 303 post(s)
|
Offhand I can't think of a way to do this via the API (but I'm not saying its impossible via the API). With that said, it's likely easier to create an Extension that interacts with the SessionManager directly to return the information you want. This extension would contain a single WebService class which looks similar to: Code:
public class Service : WebServiceBase
{
public Guid[] GetSessionIDsWithGuestConnections()
{
return SessionManagerPool.Demux.GetSessions()
.Where(_ => _.ActiveConnections.Length > 0)
.Select(s => s.SessionID)
.ToArray();
}
public Guid[] GetSessionIDsWithNoGuestConnections()
{
return SessionManagerPool.Demux.GetSessions()
.Where(_ => _.ActiveConnections.Length == 0)
.Select(s => s.SessionID)
.ToArray();
}
}
And invoking either of those methods via curl/wget/webrequest/whatever would return the desired information. The methods could easily be expanded to return the whole Session object instead of just the SessionID if that's more desirable. |
ScreenConnect Team |
|
|
|
ConnectWise Control Software User Forum
»
Default
»
Advanced Customization
»
6.6 API - Is there a single call to get the online/offline status of all sessions?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.