Skip to main content

SessionLog

Returns a list of recent session records for a specified user, useful for auditing login activity.

:::caution Established API The SOAP API is in maintenance mode. There is no direct REST equivalent for this method. :::

Method Signature

ArrayOfSessionIDInfo SessionLog(string SessionID, int UserID, short MaxRecords)

Parameters

ParameterTypeRequiredDescription
SessionIDstringYesActive session token obtained from Login
UserIDintYesNumeric ID of the user whose session history to retrieve. Pass 0 to retrieve sessions for the currently authenticated user
MaxRecordsshortYesMaximum number of session records to return. Typical values: 10100

Response Object — ArrayOfSessionIDInfo

Returns an array of SessionIDInfo objects, each representing one session record.

FieldTypeDescription
SessionIDstringSession token for this historical session
UserIDintNumeric ID of the user who owned the session
NetworkIDintNetwork ID associated with the session
MailboxIDintDefault mailbox ID for the session
CreateddateTimeUTC timestamp when the session was created
ExpiresdateTimeUTC timestamp when the session expired or was invalidated
<!-- Example response -->
<SessionLogResponse xmlns="http://www.ecgridos.net/">
<SessionLogResult>
<SessionIDInfo>
<SessionID>A1B2C3D4-E5F6-7890-ABCD-EF1234567890</SessionID>
<UserID>12345</UserID>
<NetworkID>100</NetworkID>
<MailboxID>200</MailboxID>
<Created>2026-05-07T08:00:00Z</Created>
<Expires>2026-05-07T09:00:00Z</Expires>
</SessionIDInfo>
<SessionIDInfo>
<SessionID>B2C3D4E5-F6A7-8901-BCDE-F12345678901</SessionID>
<UserID>12345</UserID>
<NetworkID>100</NetworkID>
<MailboxID>200</MailboxID>
<Created>2026-05-06T14:30:00Z</Created>
<Expires>2026-05-06T15:30:00Z</Expires>
</SessionIDInfo>
</SessionLogResult>
</SessionLogResponse>

Code Examples

// .NET 10 — dotnet-svcutil generated proxy
using var client = new ECGridOSClient(binding, endpoint);

// Retrieve the last 20 sessions for the current user
SessionIDInfo[] sessions = await client.SessionLogAsync(
sessionID,
userID: 0, // 0 = current authenticated user
maxRecords: 20);

foreach (var s in sessions)
{
Console.WriteLine($"{s.Created:O}{s.Expires:O} [{s.SessionID}]");
}

REST Equivalent

There is no direct REST equivalent for SessionLog. For user activity auditing on the REST API, use the Reports endpoints.