Skip to content

Unoffical Autodesk Platform Service (APS) .NET SDK

Notifications You must be signed in to change notification settings

GGJason/APS.NET

Repository files navigation

ApsNET - the C# library for the APS API (Formly Forge API)

APS API based on https://aps.autodesk.com

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • SDK version: 1.0.0
  • Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

Generate the DLL using your preferred tool (e.g. dotnet build)

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using ApsNET.Api;
using ApsNET.Client;
using ApsNET.Model;

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using ApsNET.Api;
using ApsNET.Client;
using ApsNET.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://developer.api.autodesk.com";
            var apiInstance = new TwoLeggedApi(config);
            var clientId = clientId_example;  // string | Client ID of the app
            var clientSecret = clientSecret_example;  // string | Client secret of the app
            var grantType = grantType_example;  // string | Must be client_credentials (default to "client_credentials")
            var scopes = scopes_example;  // string | Space-separated list of required scopes Note: A URL-encoded space is %20. * See the [Scopes](https://aps.autodesk.com/en/docs/oauth/v1/overview/scopes) page for more information on when scopes are required.  (optional) 

            try
            {
                // Get a two-legged access token by providing your app’s client ID and secret.
                Bearer result = apiInstance.AuthenticationV1AuthenticatePost(clientId, clientSecret, grantType, scopes);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling TwoLeggedApi.AuthenticationV1AuthenticatePost: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://developer.api.autodesk.com

Class Method HTTP request Description
TwoLeggedApi AuthenticationV1AuthenticatePost POST /authentication/v1/authenticate Get a two-legged access token by providing your app’s client ID and secret.

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

About

Unoffical Autodesk Platform Service (APS) .NET SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published