SDK
There is a .NET SDK for the Assets API published on nuget.
It can be found here:
https://www.nuget.org/packages/AIH.Assets.Clients
Install with (dotnet CLI):
dotnet add package AIH.Assets.Clients
#
Code Examples#
Printing all plant names in the systemThis is a console app that prints all plant names in the system.
Exchange URL_FOR_IDENTITYSERVER, URL_FOR_ASSETS, CLIENT_ID, and SECRET with your own values.
using AIH.SDK.Clients;using AIH.Assets.Clients.v1_4;
namespace Example{ class Program { static async Task Main(string[] args) { var client = new AssetsClient(new(), "https://URL_FOR_IDENTITYSERVER", new AIHClientAuthenticationOptions("https://URL_FOR_ASSETS", "CLIENT_ID", "SECRET", "AIH.Assets"));
var plants = await client.PlantsGetAsync();
foreach (var p in plants) { Console.WriteLine(p.Name); } } }}