Adsk.Platform.Tandem 0.3.1

dotnet add package Adsk.Platform.Tandem --version 0.3.1
                    
NuGet\Install-Package Adsk.Platform.Tandem -Version 0.3.1
                    
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="Adsk.Platform.Tandem" Version="0.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Adsk.Platform.Tandem" Version="0.3.1" />
                    
Directory.Packages.props
<PackageReference Include="Adsk.Platform.Tandem" />
                    
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 Adsk.Platform.Tandem --version 0.3.1
                    
#r "nuget: Adsk.Platform.Tandem, 0.3.1"
                    
#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 Adsk.Platform.Tandem@0.3.1
                    
#: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=Adsk.Platform.Tandem&version=0.3.1
                    
Install as a Cake Addin
#tool nuget:?package=Adsk.Platform.Tandem&version=0.3.1
                    
Install as a Cake Tool

Adsk.Platform.Tandem

⚠️ UNOFFICIAL PACKAGE ⚠️

A .NET SDK providing a Fluent API for the Autodesk Tandem APIs, generated from the official OpenAPI specifications using Microsoft Kiota.

Features

This SDK provides access to Tandem API endpoints through a unified client:

API Endpoint Path
Groups /tandem/v1/groups/*
Modeldata /tandem/v1/modeldata/*
Models /tandem/v1/models/*
Timeseries /tandem/v1/timeseries/*
Twins /tandem/v1/twins/*

Installation

dotnet add package Adsk.Platform.Tandem

Quick Start

using Autodesk.Tandem;

// Provide a function that returns the access token
Func<Task<string>> getAccessToken = () => Task.FromResult("YOUR_ACCESS_TOKEN");

// Initialize the Tandem client
var tandemClient = new TandemClient(getAccessToken);

Using with 2-Legged Authentication

For server-to-server communication using client credentials (2-legged OAuth), use the Autodesk.Authentication package:

using Autodesk.Tandem;
using Autodesk.Authentication;
using Autodesk.Authentication.Helpers.Models;

// Your APS app credentials
var clientId = "YOUR_CLIENT_ID";
var clientSecret = "YOUR_CLIENT_SECRET";

// Define the required scopes
var scopes = new[] { "data:read", "data:write" };

// Create authentication client
var authClient = new AuthenticationClient();

// Create an auto-refreshing token provider (handles token expiration automatically)
var tokenStore = new InMemoryTokenStore();
var getAccessToken = authClient.Helper.CreateTwoLeggedAutoRefreshToken(
    clientId, 
    clientSecret, 
    scopes, 
    tokenStore);

// Initialize the Tandem client with auto-refreshing token
var tandemClient = new TandemClient(getAccessToken);

Usage Examples

Get Twins

// Get all twins (facilities) accessible to the user
var twins = await tandemClient.Twins.GetAsync();

Get Models

// Get models for a twin
var models = await tandemClient.Models[twinId].GetAsync();

Using the Full API

For endpoints not available through shortcuts, use the Api property to access the full API structure:

// Access the full API
var result = await tandemClient.Api.Tandem.V1.Twins.GetAsync();

API Structure

The SDK provides convenient shortcut properties for common endpoints:

Property Description
tandemClient.Groups Facility groups management APIs
tandemClient.Modeldata Model data query APIs
tandemClient.Models Models management APIs
tandemClient.Timeseries Time series data APIs
tandemClient.Twins Digital twin (facility) management APIs

Custom HttpClient

You can provide your own HttpClient instance for advanced scenarios:

var httpClient = new HttpClient();
// Configure your HttpClient...

var tandemClient = new TandemClient(getAccessToken, httpClient);

Rate Limiting

The SDK handles API rate limits automatically thanks to the built-in retry handler provided by the Kiota HTTP client. When the API returns a 429 Too Many Requests response, the SDK will:

  • Automatically retry the request with exponential backoff
  • Respect the Retry-After header returned by the API
  • Retry up to a configurable number of times before failing

This means you don't need to implement custom retry logic in your application — the SDK handles transient failures and rate limiting transparently.

Error Handling

By default, the SDK throws an HttpRequestException for any non-successful HTTP response (4xx or 5xx status codes). This differs from Kiota's default behavior, which requires you to check the response status manually.

The exception includes:

  • The request URI
  • The HTTP status code
  • The full HttpResponseMessage in the Data["context"] property, allowing you to inspect the request, headers, response body, and other details for debugging
try
{
    var twins = await tandemClient.Twins.GetAsync();
}
catch (HttpRequestException ex)
{
    Console.WriteLine($"Request failed: {ex.Message}");
    Console.WriteLine($"Status code: {ex.StatusCode}");

    // Access the full response for more details
    if (ex.Data["context"] is HttpResponseMessage response)
    {
        // Get request details
        Console.WriteLine($"Request URI: {response.RequestMessage?.RequestUri}");
        Console.WriteLine($"Request Method: {response.RequestMessage?.Method}");

        // Get response body
        var body = await response.Content.ReadAsStringAsync();
        Console.WriteLine($"Response body: {body}");
    }
}

If you prefer Kiota's default behavior (no automatic exception throwing), you can disable the error handler:

using Autodesk.Common.HttpClientLibrary.Middleware.Options;

// Disable error handling for a specific request
var requestConfig = new Action<RequestConfiguration<DefaultQueryParameters>>(config =>
{
    config.Options.Add(new ErrorHandlerOption { Enabled = false });
});

var twins = await tandemClient.Twins.GetAsync(requestConfig);

Requirements

  • .NET 8.0 or later
  • Valid Autodesk Platform Services (APS) access token with appropriate scopes

Documentation

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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.3.1 41 3/2/2026