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
- .NET Core >=1.0
- .NET Framework >=4.6
- Mono/Xamarin >=vNext
- RestSharp - 106.11.4 or later
- Json.NET - 12.0.3 or later
- JsonSubTypes - 1.7.0 or later
- System.ComponentModel.Annotations - 4.7.0 or later
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
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;
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;
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);
}
}
}
}
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. |
All endpoints do not require authorization.