Tuesday 20 September 2016

SilverPop Integration ASP.NET - Login process



How to setup SilverPop

There are few documents which help us to configure the SilverPop for our needs.

This document contains all the information of how to setup the SilverPop to function as an emailing tool 

and by following the steps we can easily shoot an email or create emailing template for our need.

In short this document describes SilverPop's emailing process in detail.

Using the code

The one thing the documents doesn't describe is how to integrate the tool in our 

application(.NET application) which is required to send an email by using code.

If any user uses SilverPop for fulfilling their emailing needs then here is the way to integrate the same 

in application.

For integrating the SilverPop we need to add the reference of 


There are various API's for using the SilverPop, some useful APIs are mentioned as follows:

1.Session Management Interfaces

These interfaces are useful in authenticating with the tool.

User Login

Before calling any other interface we need to get authenticated first by using Login interface.

If Silverpop successfully authenticated the request with the provided credentials then it will return 


SUCCESS=true and SESSIONID which will be used for making call to Silverpop's interface(s).

/// <summary>
/// Login API used for authenticating with Silverpop.

/// </summary>
/// <param name="userName">user name.</param>
/// <param name="password">password.</param>
/// <returns>Lgoin status.</returns>
private string Login(string userName, string password)

{

if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(password))

{

throw new Exception("User name or password is null or empty.");

}
else
{
EngageSoapApiClientService_InterfaceClient engage = new EngageSoapApiClientService_InterfaceClient();

LoginRequestType loginRequest = new LoginRequestType(); SessionMgmtResponseType sessionMgmtResponse = new SessionMgmtResponseType(); loginRequest.USERNAME = userName;

loginRequest.PASSWORD = password; sessionMgmtResponse = engage.Login(loginRequest); if (sessionMgmtResponse.SUCCESS)

return sessionMgmtResponse.SESSIONID; else


return null;
}

}

1 comment: