ScanUpload.Api.Client 1.0.0

dotnet add package ScanUpload.Api.Client --version 1.0.0
                    
NuGet\Install-Package ScanUpload.Api.Client -Version 1.0.0
                    
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="ScanUpload.Api.Client" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ScanUpload.Api.Client" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ScanUpload.Api.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ScanUpload.Api.Client --version 1.0.0
                    
#r "nuget: ScanUpload.Api.Client, 1.0.0"
                    
#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.
#:package ScanUpload.Api.Client@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ScanUpload.Api.Client&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ScanUpload.Api.Client&version=1.0.0
                    
Install as a Cake Tool

ScanUpload.Api.Client – .NET Integration Guide

ScanUpload enables the integration and the ability to use QR codes to scan and upload files directly from a mobile device to your webapp. This guide explains how to integrate ScanUpload.Api.Client into a modern or legacy .NET application. The client library targets .NET Standard 2.1, making it compatible with:

  • .NET 6+
  • .NET 7
  • .NET 8
  • .NET 9
  • .NET 10 (preview)
  • ASP.NET Core applications
  • Older supported .NET runtimes that support .NET Standard 2.1

Front-end integrations

This official client library is designed to work seamlessly with certain ScanUpload front-end components, such as:

Prerequisites

dotnet new webapi -n ScanUploadExample
cd  ScanUploadExample

This works for:

  • .NET 6+
  • .NET 9 / 10 previews
  • Existing ASP.NET Core projects

Install the ScanUpload API client

dotnet add package ScanUpload.Api.Client --version 1.0.0
dotnet add package Microsoft.Extensions.Http.Resilience

Using Visual Studio

  1. Right‑click the project → Manage NuGet Packages
  2. Enable Include prerelease
  3. Search for ScanUpload.Api.Client
  4. Install the latest version
  5. Install Microsoft.Extensions.Http.Resilience (optional)

Configuration

Add the ScanUpload configuration section to appsettings.json:

  "ScanUploadProxy": {
    "ScanUploadTargetBaseUrl": "https://hub.scanupload.net/api/front-end",
    "ScanUploadRoutePrefix": "/scanupload-api",
    "ScanUploadTokenRoute": "/scanupload-api/token",
    "ScanUploadStripRoutePrefix": true,
    "ScanUploadRequestTimeout": "00:01:30",
    "ScanUploadHeadersToForward": [
      "Authorization",
      "Content-Type",
      "User-Agent",
      "X-Requested-With",
      "X-API-Key"
    ],
    "ScanUploadApiClient": {
      "ScanUploadBaseUrl": "https://hub.scanupload.net"
    },
    "ScanUploadAdditionalHeaders": {
      "X-Forwarded-By": "ScanUpload-Proxy",
      "X-Proxy-Version": "1.0"
    },
    "KeycloakServerUrl": "https://identity.scanupload.net/",
    "KeycloakRealm": "scanupload-hub",
    "KeycloakScope": "openid profile email scanupload.hub"
  }

🔐 For local development, store secrets using User Secrets instead of committing them to source control.

Configure user secrets

Please use ASP.NET Core user secrets for local development. These values are not committed to source control.

dotnet user-secrets init

Add your ScanUpload credentials:

dotnet user-secrets set "ScanUploadProxy:KeycloakClientId"  "your-client-id"  
dotnet user-secrets set "ScanUploadProxy:KeycloakClientSecret"  "your-client-secret"

This creates a secrets.json file in your local user profile, for example:

{
  "ScanUploadProxy": {
    "KeycloakClientId": "your-client-id",
    "KeycloakClientSecret": "your-client-secret"
  }
}

Configure services in Program.cs

Register ScanUpload services

builder.Services.Configure<ScanUploadProxyOptions>(
    builder.Configuration.GetSection("ScanUploadProxy")
);

builder.Services.AddScanUploadProxy(
    builder.Configuration.GetSection("ScanUploadProxy").Bind,
    builder =>
    {
        builder.AddStandardResilienceHandler();
    }
);

builder.Services.AddScanUploadApiClient(
    builder.Configuration,
    builder =>
    {
        builder.AddStandardResilienceHandler();
    }
);

Enable the ScanUpload proxy middleware

Add the middleware after routing and before endpoints:

app.UseScanUploadProxy();

Minimal Program.cs example

using ScanUpload.Api.Client.Extensions;
using ScanUpload.Api.Client.Interface;
using ScanUpload.Api.Client.KeycloakIntegration;

var builder = WebApplication.CreateBuilder(args);

builder.Services.Configure<ScanUploadProxyOptions>(
    builder.Configuration.GetSection("ScanUploadProxy")
);

builder.Services.AddScanUploadProxy(
    builder.Configuration.GetSection("ScanUploadProxy").Bind,
    builder =>
    {
        builder.AddStandardResilienceHandler();
    }
);

builder.Services.AddScanUploadApiClient(
    builder.Configuration,
    builder =>
    {
        builder.AddStandardResilienceHandler();
    }
);

builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

var app = builder.Build();

app.UseHttpsRedirection();
app.UseAuthorization();

app.UseScanUploadProxy();

app.MapControllers();

app.Run();

Compatibility notes

  • The client targets .NET Standard 2.1
  • Works with both modern and older ASP.NET Core applications
  • Safe to use in long‑term support (LTS) environments
  • Fully compatible with Docker and cloud deployments

Resilience and reliability (Optional)

The client integrates with Microsoft.Extensions.Http.Resilience, providing:

  • Automatic retries
  • Timeouts
  • Circuit breakers
  • Transient fault handling

This ensures reliable communication with the ScanUpload API in production.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  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.