Synergetic.Api 0.0.1-alpha

This is a prerelease version of Synergetic.Api.
dotnet add package Synergetic.Api --version 0.0.1-alpha
NuGet\Install-Package Synergetic.Api -Version 0.0.1-alpha
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Synergetic.Api" Version="0.0.1-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Synergetic.Api --version 0.0.1-alpha
#r "nuget: Synergetic.Api, 0.0.1-alpha"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Synergetic.Api as a Cake Addin
#addin nuget:?package=Synergetic.Api&version=0.0.1-alpha&prerelease

// Install Synergetic.Api as a Cake Tool
#tool nuget:?package=Synergetic.Api&version=0.0.1-alpha&prerelease

Synergetic.API

A .NET Core, Standard and Framework async implementation of the Synergetic API. The API has been developed against the API at Synergetic version 70.16.1.

This is an unoffical library.

Synergetic API developer documentation can be found at https://developer.synergetic.net.au/

Note: Only GET requests have been tested so far

Usage

Initialisation

Before you can use the Synergetic API client, you first need to configure it in your application. This only has to be done once.

Automatically acquiring a token

By default, the API client to automatically acquires the token if it has not previously been acquired, or has expired. For a web application, call the following code in Startup.cs

SynergeticClient.Initialise("{ClientId}", "{ClientSecret}", "{SynergeticAPIUrl}"); 

You do not need to call the AcquireToken method (below) when doing this.

Manually acquiring a token

There may be times where you want to control the timing of the extra network call when acquiring a token. By default, the API client automatically acquires a token, or refreshes it if it has expired. To change this behaviour, set automaticallyAcquireToken to 'false'.

For a web application, call the following code in Startup.cs

SynergeticClient.Initialise("{ClientId}", "{ClientSecret}", "{SynergeticAPIUrl}", automaticallyAcquireToken: false); 

Next acquire a token to use for subsiquent API calls

SynergeticClient.AcquireToken(); 

Using the API

Once you have initialised the client, you can query the Synergetic API by creating an instance of the appropiate service and using the Get/Create/Update methods.

Current services available are:

Querying the API
using Synergetic.Api.Services.Students;

var studentService = new StudentService();
var students = studentService.Get();

Updating or Creating Records
NOTE: These methods are untested

Following the Synergetic API spec, a list of new items, or items to update can be posted to the API.

using Synergetic.Api.Services.StudentAllergies;

var studentAllergyService = new StudentAllergyService();

var allergies = new List<CreateStudentAllergyRequest>(){ ... }

var results = studentService.Create(allergies);

The API wrapper also allows only one item to be create/updated:

using Synergetic.Api.Services.StudentAllergies;

var studentAllergyService = new StudentAllergyService();

var allergy = new CreateStudentAllergyRequest(){ ... }

var result = studentService.Create(allergy);

These methods will return a list of EntityResult object if more than one object is passed, or a single EntityResult if only one object is passed.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.1-alpha 120 6/8/2022