{"id":20382654,"url":"https://github.com/autodesk-forge/forge-api-dotnet-design.automation","last_synced_at":"2025-04-12T08:53:46.049Z","repository":{"id":34293068,"uuid":"165914206","full_name":"Autodesk-Forge/forge-api-dotnet-design.automation","owner":"Autodesk-Forge","description":"Forge Design Automation .NET SDK: Provides .NET SDK to help you easily integrate Forge Design Automation v3 REST APIs into the application","archived":false,"fork":false,"pushed_at":"2025-02-01T00:23:14.000Z","size":499,"stargazers_count":29,"open_issues_count":5,"forks_count":14,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-12T08:53:40.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Autodesk.Forge.DesignAutomation","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Autodesk-Forge.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-15T19:55:12.000Z","updated_at":"2024-11-22T23:31:02.000Z","dependencies_parsed_at":"2024-05-01T01:45:47.864Z","dependency_job_id":"37c2b4bd-ecc3-457b-bee4-467c189279b5","html_url":"https://github.com/Autodesk-Forge/forge-api-dotnet-design.automation","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Autodesk-Forge%2Fforge-api-dotnet-design.automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Autodesk-Forge%2Fforge-api-dotnet-design.automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Autodesk-Forge%2Fforge-api-dotnet-design.automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Autodesk-Forge%2Fforge-api-dotnet-design.automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Autodesk-Forge","download_url":"https://codeload.github.com/Autodesk-Forge/forge-api-dotnet-design.automation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248543882,"owners_count":21121838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T02:18:30.231Z","updated_at":"2025-04-12T08:53:46.025Z","avatar_url":"https://github.com/Autodesk-Forge.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Autodesk.Forge.DesignAutomation\n\n[![Design-Automation](https://img.shields.io/badge/Design%20Automation-v3-green.svg)](http://developer.autodesk.com/) \n![SDK](https://img.shields.io/badge/SDK-5.0.0-lightgree.svg)\n![.NET](https://img.shields.io/badge/.NET%20-6-blue.svg)\n![BUILD](https://github.com/Autodesk-Forge/forge-api-dotnet-design.automation/workflows/.NET%20Core/badge.svg?branch=main)\n[![nuget](https://img.shields.io/nuget/v/Autodesk.Forge.DesignAutomation?logo=nuget\u0026color=blue)](https://www.nuget.org/packages/Autodesk.Forge.DesignAutomation)\n\n## Overview\n\n.NET SDK for **Design Automation v3 API**, for more information, please visit  [official documentation](https://forge.autodesk.com/en/docs/design-automation/v3/)\n\nFor clients with straightforward needs one high level API client is provided in  [DesignAutomationClient](/src/Autodesk.Forge.DesignAutomation/ApiClient.gen.cs). For clients with more varied needs the following low level API classes are provided: [ActivitiesApi](/src/Autodesk.Forge.DesignAutomation/Http/ActivitiesApi.gen.cs), [AppBundlesApi](/src/Autodesk.Forge.DesignAutomation/Http/AppBundlesApi.gen.cs), [EnginesApi](/src/Autodesk.Forge.DesignAutomation/Http/EnginesApi.gen.cs),\n[ForgeAppsApi](/src/Autodesk.Forge.DesignAutomation/Http/ForgeAppsApi.gen.cs), [HealthApi](/src/Autodesk.Forge.DesignAutomation/Http/HealthApi.gen.cs), [SharesApi](/src/Autodesk.Forge.DesignAutomation/Http/SharesApi.gen.cs), [WorkItemsApi](/src/Autodesk.Forge.DesignAutomation/Http/WorkItemsApi.gen.cs).\n\n\n### Requirements\n\n- [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) or later\n- A registered app on the [Forge Developer Portal](http://forge.autodesk.com). \n\n### Dependencies\n\n- [Autodesk.Forge.Core](https://github.com/autodesk-forge/forge-api-dotnet-core) assembly which provides services such as: \n    - Acquisition of [2 legged oauth token](https://forge.autodesk.com/en/docs/oauth/v2/tutorials/get-2-legged-token/) (and refreshing it when it expires) \n    - Preconfigurated resiliency patterns (e.g. retry) using [Polly](https://github.com/App-vNext/Polly)\n\n### Changelog\n\nThe change log for the SDK can be found [here](../../releases).\n\n### Contributions\n\nContributions are welcome! Please open a Pull Request.\n\n## Support\n\nPlease ask questions on [StackOverflow](https://stackoverflow.com/questions/ask?tags=autodesk-designautomation,csharp) with tag `autodesk-designautomation` tag. If it turns out that you may have found a bug, please open an issue\n\n## Getting Started\n\nTo use the API you must instantiate one of the API classes and configure it with the valid forge credentials. You can do this in 2 ways:\n1. By using dependency injection and [configuration providers](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/#providers\n) (PREFERRED)\n2. By directly creating instances of one of API classes and the Autodesk.Forge.Core.ForgeConfiguration class and setting is properites\n\n### Configuration\n\nThere are 2 classes that you can use to configure the API:\n\n1. [Autodesk.Forge.Core.ForgeConfiguration](https://github.com/autodesk-forge/forge-api-dotnet-shared/blob/master/src/ForgeConfiguration.cs) - Allows the configuration of Forge client credentials and alternative authentication service endpoint (default is https://developer.api.autodesk.com/authentication/v2/token)\n\n2. [Autodesk.Forge.DesignAutomation.Configuration](src/Autodesk.Forge.DesignAutomation/Configuration.gen.cs)- Allows the configuration of non-default API endpoint (default is https://developer.api.autodesk.com/da/us-east/). \n\nThis SDK integrates with the .netcore configuration system. You can configure the above values via any configuration provider (e.g. `appsettings.json` or environment variables).\nFor example to set the Forge credentials you could define the following environment variables:\n\n```bash\nForge__ClientId=\u003cyour client id\u003e\nForge__ClientSecret=\u003cyour client secret\u003e\n```\n\nor the following in your `appsettings.json`:\n\n```json\n{\n    \"Forge\": {\n        \"ClientId\" : \"\u003cyour client id\u003e\",\n        \"ClientSecret\" : \"\u003cyour client secret\u003e\"\n    }\n}\n```\n\nor using environment variables with `ForgeAlternativeConfigurationExtensions`:\n\n```bash\nFORGE_CLIENT_ID=\u003cyour client id\u003e\nFORGE_CLIENT_SECRET=\u003cyour client secret\u003e\n```\n \n Starting with version 4.3 you can also configure multiple ClientId/ClientSecret pairs as follows:\n\n ```\n {\n  \"Forge\": {\n    \"ClientId\": \"\u003cdefault clientId\u003e\"\n    \"ClientSecret\" : \"\u003cdefault clientSecret\u003e\"\n    \"Agents\": {\n      \"agent1\": {\n        \"ClientId\": \"\u003cclientId of agent1\u003e\"\n        \"ClientSecret\" : \"\u003cclientSecret of agent1\u003e\"\n      },\n       \"agent2\": {\n        \"ClientId\": \"\u003cclientId of agent2\u003e\"\n        \"ClientSecret\" : \"\u003cclientSecret of agent2\u003e\"\n      }\n    },\n    ...\n}\n ```\n\n These credentials are used when you create a named `DesignAutomationClient` via [DesignAutomationFactory.CreateClient(string name)](src/Autodesk.Forge.DesignAutomation/ApiClientFactory.cs#L37) where `name` should match the name of the agent in configuration.\n### Examples\n\n#### Tutorials\n\nPlease visit [Learn Forge](https://learnforge.autodesk.io/#/tutorials/modifymodels) tutorial.\n\n#### Using dependency injection\nFirst you must add Autodesk.Forge.DesignAutomation services. This is usually done in `ConfigureServices(...)` method of your Startup class. [More information](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection)\n\n__NOTE__: This example assumes that you are building an [Asp.Net Core](https://docs.microsoft.com/en-us/aspnet/core/) web api or website. \nIf you want to use dependency injection in a console app then follow [this example](https://keestalkstech.com/2018/04/dependency-injection-with-ioptions-in-console-apps-in-net-core-2/).\n\n```csharp\nusing Autodesk.Forge.DesignAutomation;\nusing Autodesk.Forge.DesignAutomation.Model;\n...\npublic void ConfigureServices(IServiceCollection services)\n{\n    services.AddDesignAutomation(this.Configuration);\n}\n```\n\nThen you can use any of the API classes or interfaces in a constructor:\n\n```csharp\nusing Autodesk.Forge.DesignAutomation;\n...\npublic class SomeApiController : ControllerBase\n{\n    public SomeApiController(IWorkItemsApi forgeApi)\n    {\n        //use forgeApi here\n    }\n```\n\n#### By directly creating API objects\n\n```csharp\nusing Autodesk.Forge.DesignAutomation;\nusing System.Net.Http;\nusing System.Threading.Tasks;\nusing Autodesk.Forge.Core;\n\ninternal class Program\n{\n    public static void Main(string[] args)\n    {\n        var service =\n            new ForgeService(\n                new HttpClient(\n                    new ForgeHandler(Microsoft.Extensions.Options.Options.Create(new ForgeConfiguration()\n                    {\n                        ClientId = \"\u003cyour client id\u003e\",\n                        ClientSecret = \"\u003cyour client secret\u003e\"\n                    }))\n                {\n                    InnerHandler = new HttpClientHandler()\n                })\n            );\n\n        var forgeApi = new WorkItemsApi(service);\n    }\n}\n```\n\n## Versioning\n\nUsing [Semantic Version](https://semver.org/) scheme following the pattern of `x.y.z.`:\n\n- `x`: MAJOR version when you make incompatible changes,\n- `y`: MINOR version when you add functionality in a backwards-compatible manner, and\n- `z`: PATCH version when you make backwards-compatible bug fixes.\n\n## Source-code\n\nGenerated with [swagger-codegen](https://github.com/swagger-api/swagger-codegen).\n\n#### Build\n```\ndotnet build Autodesk.Forge.DesignAutomation.sln\n```\n\n#### Test\n```\ndotnet test Autodesk.Forge.DesignAutomation.sln\n```\n\n\n## License\n\nThis sample is licensed under the terms of the **Apache License 2.0**. Please see the [LICENSE](LICENSE) file for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautodesk-forge%2Fforge-api-dotnet-design.automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautodesk-forge%2Fforge-api-dotnet-design.automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautodesk-forge%2Fforge-api-dotnet-design.automation/lists"}