Encompass API Client Library for .NET Framework 4.5+ and .NET Standard 1.1+.
More documentation forthcoming.
- Install the EncompassRest Nuget package.
- Create an async method in your consuming code.
- Create an
EncompassRestClient
object. - Use
EncompassRestClient
object to make API calls.
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 Controller
s actions.
public async Task<IActionResult> GetAsync()
{
// Your async code goes here
}
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();
}
The EncompassRestClient
class implements IDisposable
so it is recommended to use using
statements to automatically dispose of the object.
using (var client = await EncompassRestClient.CreateFromUserCredentialsAsync("apiClientId", "apiClientSecret", "encompassInstanceId", "encompassUserId", "encompassPassword"))
{
// use client
}
using (var client = await EncompassRestClient.CreateFromAuthorizationCodeAsync("apiClientId", "apiClientSecret", "redirectUri", "authorizationCode"))
{
// use client
}
using (var client = EncompassRestClient.CreateFromAccessToken("apiClientId", "apiClientSecret", "accessToken"))
{
// use client
}
using (var client = await EncompassRestClient.CreateAsync("apiClientId", "apiClientSecret", "encompassInstanceId",
(tokenCreator, ct) => tokenCreator.FromUserCredentialsAsync("encompassUserId", "encompassPassword", ct)))
{
// use client
}
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.