Skip to main content

Login

Authenticates a user and returns a SessionID string that must be passed as the first parameter to every subsequent SOAP API call.

:::caution Established API The SOAP API is in maintenance mode. For new integrations use the REST equivalent. :::

Method Signature

string Login(string UserName, string Password, string SenderSolution,
string SenderVersion, string SenderCompanyName,
string SenderContact, string SenderContactEmail)

Parameters

ParameterTypeRequiredDescription
UserNamestringYesECGridOS account username
PasswordstringYesAccount password. Must satisfy the complexity rule: at least one uppercase letter, one lowercase letter, one digit, and one special character
SenderSolutionstringYesName of the calling application or integration
SenderVersionstringYesVersion string of the calling application (e.g., "1.0")
SenderCompanyNamestringYesCompany name of the integration developer
SenderContactstringYesName of the technical contact responsible for the integration
SenderContactEmailstringYesEmail address of the technical contact

:::note No SessionID parameter Login is the only method that does not take a SessionID. It creates the session and returns the SessionID. :::

Response

Returns a string containing the SessionID token. Store this value and pass it as the first argument to every subsequent SOAP API call.

Sessions expire after a period of inactivity. For long-running server applications, consider refreshing the session periodically or catching authentication faults and re-authenticating.

<!-- Example response -->
<LoginResponse xmlns="http://www.ecgridos.net/">
<LoginResult>A1B2C3D4-E5F6-7890-ABCD-EF1234567890</LoginResult>
</LoginResponse>

Code Examples

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

string sessionID = await client.LoginAsync(
userName: config["ECGrid:UserName"],
password: config["ECGrid:Password"],
senderSolution: "MyIntegration",
senderVersion: "1.0",
senderCompanyName: "My Company LLC",
senderContact: "Developer Name",
senderContactEmail: "dev@example.com");

try
{
// Use sessionID for subsequent calls...
}
finally
{
// Always release the session, even on error
await client.LogoutAsync(sessionID);
}

:::tip Server applications For daemon processes and background services, session-based auth requires periodic re-authentication when sessions expire. The REST API's API Key (X-API-Key header) is stateless and better suited for server-to-server workloads. :::

REST Equivalent

See LoginPOST /v2/auth/login.