The purpose of this repository is to
This repository contains the .NET bindings, also referred to as .NET Client Libraries.
Prerequisites:
Visual Studio 2015 Or Higher
This step gets all the required packages and dependencies.
Execute the following command from your Visual Studio's Package Manager console to install all the packages at once:
PM> Install-Package Elli.Api
All DLLs obtained are Strong Named. You can verify this once the DLL is imported into the project, by clicking on the Properties of the DLL and looking for the property "Strong Name". This value should be true.
In addition to the internal dependencies, the following external dependencies are also installed:
RestSharpSigned version 105.1.0
OR
RestSharp version 105.1.0
Newtonsoft.Json version 10.0.3
If you want to install the packages individually, follow the example for Loans package as follows:
PM> Install-Package Elli.Api.Loans
All available packages that will be installed are:
Elli.Api.CustomDataObjects
Elli.Api.Loans
Elli.Api.Loans.EFolder
Elli.Api.Loans.Pipeline
Elli.Api.Services
Elli.Api.Contacts
Elli.Api.Settings
Elli.Api.Schema
Elli.Api.Tools
Note: Each of the above packages references all dependencies including Oauth Client and Base DLL. If you wish to install just the OAuth reference, execute the following command:
PM> Install-Package Elli.Api.OAuth
Elli.Api.Base enables easy configuration for project. Depending on the type of the project, in the web.config or app.config file, add following section for configuration:
<configSections>
...
<section name="ElliApiConfig" type="Elli.Api.Base.ApiConfiguration, Elli.Api.Base"/>
...
</configSections>
<ElliApiConfig apiHost="https://api.elliemae.com.com" apiClientId="" clientSecret="" idpHost="idp.elliemae.com" redirectUrl=""/>
Where
apiHost: this is the end point where APIs are located. In most of the cases this value is https://api.elliemae.com and should not require any changes
apiClientID and clientSecret: This value can be obtained from Encompass Developer Connect portal. If you do not have access to developer portal, please contact your account representative to obtain access.
idpHost: This is the host name where user can authenticate for auth code flow. In most of the cases this value is idp.elliemae.com and should not require any changes
redirectUrl: This is the url where user will be redirected in case of authcode flow. For security reasons, this must be an https end point, else the redirect will not work.
var {varName} = ApiClientProvider.GetApiClient<{TypeOf Client}>({Access Token Object});
{varName}.{apicall}([{parameters}]);
The Access token can be obtained by using either of the following examples.
Using ROPC Flow:
var credentials = new UserCredential
{
Password =password,
IdentityType = IdentityType.Lender,
InstanceId = instanceId,
UserName = userName
};
var accessToken = AccessToken.GetAccessToken(credentials);
Using Auth Code Flow: In authcode flow, user is authenticated on Ellie Mae Identity provider and a code is given back to redirect url as a query parameter
var accessToken = AccessToken.GetAccessToken(code);
For any further references for coding, please refer to the sample applications in this repository.
There are two folders in this repository:
There are several pieces in ths API which are used frequently in the context of API Clients.
The Elli.Api.Base.dll contains helper classes for such common uses.
The Elli.Api.Base Namespace contains AccessToken class. This class is designed to reduce the redundancy in the code for Access Token related operations. A user can be authenticated and get an exchange token using either ROPC flow or Auth Code flow. This class supports both approaches, getting access token using ROPC Flow as well as getting exchange token for an auth code obtaind using interactive login through the console UI.
Both the flows are demonstrated in the Samples/OAuth folder.
While initializing an API client, it requires certain values such as end point and access token as necessary. Throughout the sample apps, this initialization is demonstrated.
All the DLLs are part of Nuget and are available as packages with necessary dependencies.
If you wish to change the API Client's behavior, DotNetBindings folder has a .Net solution with all dependencies. Referring to this project in target Dll will modify the behavior as required.
Each sample application and corresponding code has required comments to help developers understand what each step is doing and best practices around them. The sample applications that are made available in this repository cater to OAuth 2.0 and demonstration
Second example is a web application to demonstrate AuthCode flow and exchange auth code for an exchange token