{"id":37043943,"url":"https://github.com/contentstack/contentstack-management-dotnet","last_synced_at":"2026-01-14T05:03:08.323Z","repository":{"id":64901726,"uuid":"381655249","full_name":"contentstack/contentstack-management-dotnet","owner":"contentstack","description":"The Content Management SDK is used to manage the content of your Contentstack account. This includes creating, updating, deleting, and fetching content of your account","archived":false,"fork":false,"pushed_at":"2025-10-24T07:17:33.000Z","size":688,"stargazers_count":2,"open_issues_count":2,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-10-24T08:28:38.200Z","etag":null,"topics":["cms","content-management-system","contentstack","contentstack-dotnet","library","sdk"],"latest_commit_sha":null,"homepage":"https://www.contentstack.com/docs/developers/apis/content-management-api/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/contentstack.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":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-06-30T09:59:00.000Z","updated_at":"2025-09-29T09:41:29.000Z","dependencies_parsed_at":"2024-01-22T06:36:15.863Z","dependency_job_id":"2d57a473-0e2a-43d8-bcad-bbd614533f5e","html_url":"https://github.com/contentstack/contentstack-management-dotnet","commit_stats":{"total_commits":70,"total_committers":3,"mean_commits":"23.333333333333332","dds":0.2571428571428571,"last_synced_commit":"1cec2b01a99aae97f897c6d5e46b91ecf5492f60"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/contentstack/contentstack-management-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentstack%2Fcontentstack-management-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentstack%2Fcontentstack-management-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentstack%2Fcontentstack-management-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentstack%2Fcontentstack-management-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/contentstack","download_url":"https://codeload.github.com/contentstack/contentstack-management-dotnet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentstack%2Fcontentstack-management-dotnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28410133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cms","content-management-system","contentstack","contentstack-dotnet","library","sdk"],"created_at":"2026-01-14T05:03:07.617Z","updated_at":"2026-01-14T05:03:08.318Z","avatar_url":"https://github.com/contentstack.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Contentstack](https://www.contentstack.com/docs/static/images/contentstack.png)](https://www.contentstack.com/)\n\n## Contentstack Management .NET SDK\n\nContentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. All you have to do is build your application frontend, and Contentstack will take care of the rest. [Read More](https://www.contentstack.com/).\n\nThis SDK uses the [Content Management API](https://www.contentstack.com/docs/developers/apis/content-management-api/) (CMA). The CMA is used to manage the content of your Contentstack account. This includes creating, updating, deleting, and fetching content of your account. To use the CMA, you will need to authenticate your users with a [Management Token](https://www.contentstack.com/docs/developers/create-tokens/about-management-tokens) or an [Authtoken](https://www.contentstack.com/docs/developers/apis/content-management-api/#how-to-get-authtoken). Read more about it in [Authentication](https://www.contentstack.com/docs/developers/apis/content-management-api/#authentication).\n\nNote: By using CMA, you can execute GET requests for fetching content. However, we strongly recommend that you always use the [Content Delivery API](https://www.contentstack.com/docs/developers/apis/content-delivery-api/) to deliver content to your web or mobile properties.\n\n### Prerequisite\n\nYou need .NET installed on your machine to use the Contentstack .NET CMA SDK.\n\n### Installation\nOpen the terminal and install the contentstack module via ‘Package Manager’ command\n```\nPM\u003e Install-Package Contentstack.Management.Core\n```\nAnd via ‘.Net CLI’\n```\ndotnet add package Contentstack.Management.Core\n```\nTo use the module in your application, you need to first Add Namespace to your class\n```c#\nusing Contentstack.Management.Core; // ContentstackClient, ContentstackClientOptions, ContentstackResponse \nusing Contentstack.Management.Core.Models; // Stack, ContentType, Entry, Asset\n```\n\n### Authentication\nTo use this SDK, you need to authenticate your users by using the Authtoken, credentials, or Management Token (stack-level token).\n### Authtoken\nAn [Authtoken](https://www.contentstack.com/docs/developers/create-tokens/types-of-tokens/#authentication-tokens-authtokens-) is a read-write token used to make authorized CMA requests, and it is a **user-specific** token.\n\n```c#\nvar options = new ContentstackOptions()\n{\n    Host = \"\u003cAPI_HOST\u003e\",\n    Authtoken = \"\u003cAUTHTOKEN\u003e\"\n}\nContentstackClient client = new ContentstackClient(new OptionsWrapper\u003cContentstackClientOptions\u003e(options));\n```\n\n### Login\nTo Login to Contentstack by using credentials, you can use the following lines of code:\n```c#\n    ContentstackClient client = new ContentstackClient();\n    NetworkCredential credentials = new NetworkCredential(\"\u003cEMAIL\u003e\", \"\u003cPASSWORD\u003e\");\n\n    // Sync call\n    ContentstackResponse contentstackResponse = client.Login(credentials);\n\n    // Async call\n    client.LoginAsync(credentials).ContinueWith((t) =\u003e {\n        if (t.IsCompleted \u0026\u0026 t.Status != System.Threading.Tasks.TaskStatus.Faulted)\n        {\n            // success\n        }\n    });\n    \n```\n\n### Management Token\n[Management Tokens](https://www.contentstack.com/docs/developers/create-tokens/about-management-tokens/) are **stack-level** tokens, with no users attached to them.\n```c#\n    Stack stack = client.Stack(\"\u003cAPI_KEY\u003e\", \"\u003cMANAGEMENT_TOKEN\u003e\");\n```\n### Contentstack Management .NET SDK: 5-minute Quickstart\n#### Initializing Your SDK:\nTo use the .Net CMA SDK, you need to first initialize it. To do this, use the following code:\n```c#\nusing Contentstack.Management.Core;\n\nvar options = new ContentstackOptions()\n    {\n        Host = \"\u003cAPI_HOST\u003e\",\n        Authtoken = \"\u003cAUTHTOKEN\u003e\"\n    }\nContentstackClient client = new ContentstackClient(new OptionsWrapper\u003cContentstackClientOptions\u003e(options));\n```\n\n##### For Setting the branch:\nIf you want to initialize the SDK in a particular branch, use the following code:\n```c#\nusing Contentstack.Management.Core\n\nContentstackClient client = new ContentstackClient();\nclient.Stack(\"API_KEY\", \"MANAGEMENT_TOKEN\", \"BRANCH\");\n```\n##### Proxy Configuration\nContentstack allows you to define HTTP proxy for your requests with the .NET Management SDK. A proxied request allows you to anonymously access public URLs even from within a corporate firewall through a proxy server.\n\nHere is the basic syntax of the proxy settings that you can pass within fetchOptions of the .NET Management SDK:\n```c#\nusing System.Net;\nvar contentstackConfig = new ContentstackClientOptions();\ncontentstackConfig.ProxyHost = \"http://127.0.0.1\";\ncontentstackConfig.ProxyPort = 9000;\ncontentstackConfig.ProxyCredentials = new NetworkCredential(userName: \"username\", password: \"password\");\nContentstackClient client = new ContentstackClient(new OptionsWrapper\u003cContentstackClientOptions\u003e(options));\n```\n#### Fetch Stack Detail\nUse the following lines of code to fetch your stack detail using this SDK:\n```c#\nContentstackResponse contentstackResponse = client.Stack(\"\u003cAPI_KEY\u003e\").Fetch();\n\nvar response = contentstackResponse.OpenJObjectResponse();\n// or\nStackResponse model = contentstackResponse.OpenTResponse\u003cStackResponse\u003e();\n```\n#### Create an Entry\nYou can use the following code to create an entry in a specific content type of a stack through the SDK:\n```c#\nEntryModel entry = new EntryModel() {\n   Title: \"Sample Entry\",\n   Url: \"/sampleEntry\"\n}\nContentstackClient client = new ContentstackClient();\nStack stack = client.Stack(\"API_KEY\");\nContentstackResponse contentstackResponse = stack.ContentType(\"CONTENT_TYPE_UID\").Entry().Create(entry);\n```\n#### Upload Assets\nUse the following code snippet to upload assets to your stack through the SDK:\n```c#\nContentstackClient client = new ContentstackClient();\nStack stack = client.Stack(\"API_KEY\");\n\nvar path = Path.Combine(Environment.CurrentDirectory, \"path/to/file\");\nAssetModel asset = new AssetModel(\"Asset Title\", path, \"application/json\");\nContentstackResponse response = stack.Asset().Create(asset);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentstack%2Fcontentstack-management-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontentstack%2Fcontentstack-management-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentstack%2Fcontentstack-management-dotnet/lists"}