Open Source: infusionsoft.netstandard
A project of mine that ended, but the results contain quite some application code that could be useful to you perhaps. The first part that I want to publish is an implementation for the Infusionsoft API with .NET Standard.
I refactored the code so it becomes a separate package, just for Infusionsoft. As one of the next steps, I also want to publish as a Nuget. But so far, I could include the following functionality.
The source code is hosted on GitHub:
The solution contains of 2 projects.
- Infusionsoft.RestApi – the client implementation (.NET Standard)
- Infusionsoft.RestApi.IntegrationTests – testing the real http endpoints from Infusionsoft by filling in your id, secret, authCode and tokens (XUnit)
- Http Service implementation for Infusionsoft
- Create Infusionsoft tokens based on an OAuth code
- Refresh a token
- Read all existing contacts
- CRUD operations for contacts
- IInfusionsoftUsers – get the UserInfo for the current user (who created the access token)
RestApi Client implementation
The basic concept is this:
The static class ApiFactory contains a factory singleton that creates instances of the different Sub API’s. A sub API is a subset of the whole Infusionsoft API, following the structure of Infusionsoft’s documentation on https://developer.infusionsoft.com/docs/rest.
For each sub API, there’s a folder containing the models and implementations.
Integration test implementation
The TestService.cs class reads the configuration file containing your id, secret, code and tokens.
The TestBase.cs class retrieves all relevant informations of the config and creates the APIFactory singleton.
For each sub API, there’s folder with a test implementations.
There are a lot more implementations done already, and just have to be migrated to the project on GitHub. I hope that everyone working on Infusionsoft with .NET can take advantage of this project. And of course contribute, if there’s anything missing.
One of the next steps will be to integrate a Web Frontend with Angular 6, to show a complete OAuth2 Authorization Code workflow.
Also there will be the implementation with examples for registering and listening to RestHooks.
Just contact me before going on on yourself, because I can prioritize functions that are needed now.