Skip to content

resnovit/EncompassRest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EncompassRest

Encompass API Client Library for .NET Framework 4.5+ and .NET Standard 1.1+.

More documentation forthcoming.

Getting Started

  1. Install the EncompassRest Nuget package.
  2. Create an async method in your consuming code.
  3. Create an EncompassRestClient object.
  4. Use EncompassRestClient object to make API calls.

Create an async method

EncompassRest is a fully asynchronous library meaning all of it's Encompass API calls are made asynchronously to allow great performance for maximum throughput. To get started using the library you need to write an async method. To avoid deadlocks with async code it is recommended you DO NOT use Task.Result or the Task.Wait methods and instead implement async all the way from the top, e.g. Main or your Controllers actions.

Web apps:

public async Task<IActionResult> GetAsync()
{
    // Your async code goes here
}

Console apps:

For C#7.1 and up you should use an async Main method like so.

public async Task Main()
{
    // Your async code goes here
}

For C#7 and below you should use Task.Run inside of Main to use async methods.

public void Main()
{
    Task.Run(async () => {
        // Your async code goes here
    }).GetAwaiter().GetResult();
}

Create an EncompassRestClient object

The EncompassRestClient class implements IDisposable so it is recommended to use using statements to automatically dispose of the object.

From User Credentials

using (var client = await EncompassRestClient.CreateFromUserCredentialsAsync("apiClientId", "apiClientSecret", "encompassInstanceId", "encompassUserId", "encompassPassword"))
{
    // use client
}

From Authorization Code

using (var client = await EncompassRestClient.CreateFromAuthorizationCodeAsync("apiClientId", "apiClientSecret", "redirectUri", "authorizationCode"))
{
    // use client
}

From Access Token

using (var client = EncompassRestClient.CreateFromAccessToken("apiClientId", "apiClientSecret", "accessToken"))
{
    // use client
}

Auto-retrieve new token when expired

using (var client = await EncompassRestClient.CreateAsync("apiClientId", "apiClientSecret", "encompassInstanceId",
    (tokenCreator, ct) => tokenCreator.FromUserCredentialsAsync("encompassUserId", "encompassPassword", ct)))
{
    // use client
}

Use EncompassRestClient object

Use the various properties on EncompassRestClient such as Loans, Schema, Webhook, Pipeline, and BatchUpdate to make Encompass API calls.


If you're interested in contributing please look over the Guidelines Doc.

About

Encompass API .NET Client Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%