Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Welcome to the Digizuite C# SDK documentation. Here you will find documentation on how to use the sdk and some tips and tricks for interacting with the Digizuite in general.

Setup

To get started with the Digizuite SDK, you should first install the Digizuite packages from nuget.org https://www.nuget.org/packages/Digizuite.Sdk.
Additionally the SDK has to be initialized. If you are using dotnet, an extension method AddDigizuite is provided. Use the extension method AddDigizuite for inspiration.

A simple example of how the initialization code looks in a console application is as follows:

var serviceCollection = new ServiceCollection(); 

var config = new DigizuiteConfiguration()
{
	BaseUrl = new Uri("https://<Digizuite url>.com/"),
	SystemUsername = "<Username>",
	SystemPassword = "<Password>"
};

serviceCollection.AddDigizuite(config)
            .AddDigizuiteLogging()
            .AddConsoleSink();
serviceCollection.AddSingleton(typeof(ILogger<>), typeof(ConsoleLogger<>));
var serviceProvider = serviceCollection.BuildServiceProvider(true);

Usecases

  1. Get a single asset by assetId
    Use the Digizuite service IAssetSearchService

    var assetSearchService = serviceProvider.GetRequiredService<IAssetSearchService>();
    var assetResponse = await assetSearchService.GetAsset(75);

    The response model can be found at DC 5.8 [core api] Get assets

  2. Get a list of assets
    Use the Digizuite service IAssetSearchService

    var assetSearchService = serviceProvider.GetRequiredService<IAssetSearchService>();
    var getAssetsRequest = new GetAssetsRequest
    {
        AssetIds = new HashSet<int> { 75, 76 }
    };
    var assetResponse = await assetSearchService.GetAssets(getAssetsRequest);

    The response model can be found at DC 5.8 [core api] Get assets

  • No labels