Contentstack Management .NET SDK
.NET SDK for Contentstack's Content Management API
Contentstack 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 favourite languages. Build your application frontend, and Contentstack will take care of the rest.
For more information, you can check out the GitHub page of our .NET Management SDK.
Prerequisites
To get started with C#, you will need:
- .NET platform 3.1 and later
- IDE (Visual Studio)
- NuGet.
SDK installation and setup
The .NET SDK provided by contentstack.io is available for Xamarin, Windows Phone and legacy .NET applications. You can integrate contentstack with your application by following these steps.
Open the terminal and install the contentstack module via 'Package Manager' command
PM> Install-Package contentstack.management.csharp
And via ‘.NET CLI’
dotnet add package contentstack.management.csharp
To import the SDK, use the following code:
using Contentstack.Management.Core; ContentstackClient client = new ContentstackClient();
Or
using Contentstack.Management.Core; ContentstackClientOptions options = new ContentstackClientOptions(); ContentstackClient client = new ContentstackClient(new OptionsWrapper<ContentstackClientOptions>(options));
Quickstart in 5 mins
Initializing Your SDK
To use the .NET CMA SDK, you need to first initialize it. To do this, use the following code:
using Contentstack.Management.Core;
ContentstackClient client = new ContentstackClient("AUTHTOKEN");Authentication
To use this SDK, you need to authenticate your users by using the Authtoken, credentials, or Management Token (stack-level token).
Authtoken
An Authtoken is a read-write token used to make authorized CMA requests, and it is a user-specific token.
ContentstackClientOptions options = new ContentstackClientOptions() {
Authtoken: ‘AUTHTOKEN’
};
ContentstackClient client = new ContentstackClient(new OptionsWrapper<ContentstackClientOptions>(options));Login
To log in to Contentstack, provide your credentials as shown below.
NetworkCredential credentials = new NetworkCredential("EMAIL", "PASSWORD");
ContentstackClient client = new ContentstackClient();
try
{
ContentstackResponse contentstackResponse = client.Login(credentials);
} catch (Exception e)
{
}Management Token
Management tokens are stack-level tokens with no users attached to them.
ContentstackClient client = new ContentstackClient();
client.Stack("API_KEY", "MANAGEMENT_TOKEN");Early Access Header
Integrating EarlyAccess headers into the ContentstackClientOptions grants access to features included in the early access program
var contentstackClient = new ContentstackClient(new ContentstackClientOptions()
{
Authtoken = "token",
EarlyAccess = new string[] { "ea1", "ea2" }
});Proxy Configuration
Contentstack 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. Here is the basic syntax of the proxy settings that you can pass within fetchOptions of the .NET Management SDK:
var contentstackConfig = new ContentstackClientOptions(); contentstackConfig.ProxyHost = "http://127.0.0.1" contentstackConfig.ProxyPort = 9000; contentstackConfig.ProxyCredentials = new NetworkCredential(userName: "username", password: "password"); ContentstackClient client = new ContentstackClient(new OptionsWrapper<ContentstackClientOptions>(options));
Fetch Stack Details
To fetch your stack details through the SDK, use the following code:
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("AUTHTOKEN");
Stack stack = client.Stack("API_KEY");
ContentstackResponse contentstackResponse = stack.Fetch();
var response = contentstackResponse.OpenJObjectResponse();Create an Entry
To create an entry, you need to prepare a custom model class that represents the entry's request body. To do so, create a separate EntryModel.cs file and add your custom EntryModel class, implementing IEntry interface, as follows:
using Contentstack.Management.Core.Abstractions;
using Newtonsoft.Json;
namespace TestModels
{
public class EntryModel : IEntry
{
public EntryModel()
{
}
[JsonProperty(propertyName: "title")]
public string Title { get; set; }
[JsonProperty(propertyName: "uid")]
public string Uid { get; set; }
}
}You can use the following code to create an entry in a specific content type of a stack through the SDK:
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
EntryModel entry = new EntryModel() {
Title: 'Sample Entry',
Url: '/sampleEntry'
}
ContentstackClient client = new ContentstackClient("AUTHTOKEN");
Stack stack = client.Stack("API_KEY");
ContentstackResponse contentstackResponse = stack.ContentType(“CONTENT_TYPE_UID”).Entry().Create(entry);Upload Assets
Use the following code snippet to upload assets to your stack through the SDK:
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("AUTHTOKEN");
Stack stack = client.Stack("API_KEY");
var path = Path.Combine(Environment.CurrentDirectory, "path/to/file");
AssetModel asset = new AssetModel("Asset Title", path, "application/json");
ContentstackResponse response = stack.Asset().Create(asset);ContentstackClient
| Name | Type | Description |
|---|---|---|
| SerializerSettings | JsonSerializerSettings | Get and Set method for de-serialization. |
ContentstackClient
Initializes new instance of the Contentstack.Management.Core.ContentstackClient class.
| Name | Type | Description |
|---|---|---|
| contentstackOptions (required) | ContentstackClientOptions | Contentstack configuration options. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
var options = new ContentstackClientOptions()
{
Host = "<API_HOST>",
Authtoken = "<AUTHTOKEN>"
}
ContentstackClient client = new ContentstackClient(options);| Name | Type | Description |
|---|---|---|
| contentstackOptions | IOptions<ContentstackClientOptions> | Contentstack configuration options. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
var options = new ContentstackClientOptions()
{
Host = "<API_HOST>",
Authtoken = "<AUTHTOKEN>"
}
ContentstackClient client = new ContentstackClient(new OptionsWrapper<ContentstackClientOptions>
(options));| Name | Type | Description |
|---|---|---|
| authtoken | string | The optional Authtoken for making CMA call |
| host | string | The optional host name for the API. |
| port | int | The optional port for the API |
| version | string | The optional version for the API |
| disableLogging | bool | The optional to disable or enable logs. |
| maxResponseContentBufferSize | long | The optional maximum number of bytes to buffer when reading the response content |
| timeout | int | The optional timespan to wait before the request times out. |
| retryOnError | bool | The optional retry condition for retrying on error. |
| proxyHost | string | Host to use with a proxy. |
| proxyPort | int | Port to use with a proxy. |
| proxyCredentials | ICredentials | Credentials to use with a proxy. |
| EarlyAccess | string | Optional array of header strings for early access features. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("AUTHTOKEN");GetUser
The Get user call returns comprehensive information of an existing user account.
| Name | Type | Description |
|---|---|---|
| collection (required) | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.GetUser();GetUserAsync
The Get user call returns comprehensive information of an existing user account.
| Name | Type | Description |
|---|---|---|
| collection (required) | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.GetUserAsync();Login
The Log in to your account request is used to sign in to your Contentstack account and obtain the authtoken. Refer to the TOTP Support for .NET Management SDK for more information.
| Name | Type | Description |
|---|---|---|
| credentials (required) | ICredentials | User credentials used to authenticate the login request. |
| token | string | TOTP token generated from an authenticator app. Required for MFA-enabled users. |
| mfaSecret | string | Secret key generated when the user enables MFA in Contentstack. Used to dynamically create a TOTP token. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient();
NetworkCredential credentials = new NetworkCredential("<EMAIL>", "<PASSWORD>");
// Login when MFA is not enabled for the user
ContentstackResponse contentstackResponse = client.Login(credentials);
// Login when MFA is enabled: use a valid TOTP token generated from an authenticator app
string tfa_token = "<my_tfa_token>";
contentstackResponse = client.Login(credentials, token = tfa_token);
// Login using the MFA secret: SDK will generate the TOTP token dynamically
string mfa_secret = "<my_mfa_secret>";
contentstackResponse = client.Login(credentials, mfaSecret = mfa_secret);LoginAsync
The Log in to your account request is used to sign in to your Contentstack account and obtain the authtoken. Refer to the TOTP Support for .NET Management SDK for more information.
| Name | Type | Description |
|---|---|---|
| credentials (required) | ICredentials | User credentials used to authenticate the login request. |
| token | string | TOTP token generated from an authenticator app. Required for MFA-enabled users. |
| mfaSecret | string | Secret key generated when the user enables MFA in Contentstack. Used to dynamically create a TOTP token. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient();
NetworkCredential credentials = new NetworkCredential("<EMAIL>", "<PASSWORD>");
// Login when MFA is not enabled for the user
ContentstackResponse contentstackResponse = await client.Login(credentials);
// Login when MFA is enabled: use a valid TOTP token generated from an authenticator app
string tfa_token = "<my_tfa_token>";
contentstackResponse = await client.Login(credentials, token = tfa_token);
// Login using the MFA secret: SDK will generate the TOTP token dynamically
string mfa_secret = "<my_mfa_secret>";
contentstackResponse = await client.Login(credentials, mfaSecret = mfa_secret);Logout
The Log out of your account call is used to sign out the user of Contentstack account
| Name | Type | Description |
|---|---|---|
| authtoken | string | The optional authroken in case user want to logout. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Logout();LogoutAsync
The Log out of your account call is used to sign out the user of Contentstack account
| Name | Type | Description |
|---|---|---|
| authtoken | string | The optional authroken in case user want to logout. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.LogoutAsync();Organization
Organization the top-level entity in the hierarchy of Contentstack, consisting of stacks and stack resources, and users. Organization allows easy management of projects as well as users within the Organization.
| Name | Type | Description |
|---|---|---|
| uid | string | Organization uid for specific org. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Organization organization = client.Organization();Stack
Stack is a space that stores the content of a project (a web or mobile property). Within a stack, you can create content structures, content entries, users, etc. related to the project.
| Name | Type | Description |
|---|---|---|
| apiKey | string | Stack API Key. |
| managementToken | string | Stack Management token |
| branchUid | string | Branch uid for querying specific branch of stack. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack Stack = client.Stack("<API_KEY>");User
User session consists of calls that will help you to update user of your Contentstack account.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
User user = client.User();ContentstackClientOptions
ContentstackClientOptions class is base class for Contentstack Configuration.
| Name | Type | Description |
|---|---|---|
| Authtoken | string | An Authtoken is a read-write token used to make authorized CMA requests. |
| DisableLogging | bool | Gets or sets the DisableLogging. When set to true, the logging of the client is disabled. The default value is false. |
| Host | string | The Host used to set host url for the Contentstack Management API. |
| MaxResponseContentBufferSize | long | Gets or sets the maximum number of bytes to buffer when reading the response content. |
| Port | int | The Host used to set host url for the Contentstack Management API. |
| ProxyCredentials | ICredentials | Credentials to use with a proxy. |
| ProxyHost | string | Host for the Proxy. |
| ProxyPort | int | Port for the Proxy. |
| RetryDelay | TimeSpan | Returns the flag indicating delay in retrying HTTP requests. |
| RetryLimit | int | Returns the flag indicating how many retry HTTP requests an SDK should make for a single SDK operation invocation before giving up. |
| RetryOnError | bool | When set to true, the client will retry requests. When set to false, the client will not retry request. |
| RetryPolicy | RetryPolicy | The retry policy which specifies when a retry should be performed. |
| Timeout | TimeSpan | Gets or sets the timespan to wait before the request times out. |
| Version | string | The Host used to set host url for the Contentstack Management API. |
GetUri
Returns a Uri instance configured in the configuration.
GetWebProxy
Returns a WebProxy instance configured to match the proxy settings in the configuration.
ContentstackClientOptions
Abstract class for Response objects.
| Name | Type | Description |
|---|---|---|
| ContentLength | long | Returns the content length of the HTTP response. |
| ContentType | string | Gets the property ContentType. |
| IsSuccessStatusCode | bool | Gets a value that indicates whether the HTTP response was successful. |
| ResponseBody | HttpResponseMessage | The entire response body from the HTTP response. |
| StatusCode | HttpStatusCode | The HTTP status code from the HTTP response. |
GetHeaderNames
Gets the header names from HTTP response headers.
GetHeaderValue
Gets the value for the header name from HTTP response headers.
| Name | Type | Description |
|---|---|---|
| headerName (required) | string | Header name for which value is needed. |
IsHeaderPresent
Return true if header name present in HTTP response headers.
| Name | Type | Description |
|---|---|---|
| headerName (required) | string | Header name to check if its present. |
OpenJObjectResponse
Json Object format response.
OpenResponse
String format response.
OpenTResponse
Type response to serialize the response.
ContentstackException
A base exception for Contentstack API.
ContentstackException
Gets the header names from HTTP response headers.
| Name | Type | Description |
|---|---|---|
| message | string | The message for the exception to be created. |
| innerException | Exception | Inner exception |
ContentstackErrorException
A base exception for Contentstack API.
| Name | Type | Description |
|---|---|---|
| ErrorCode | int | This is error code. |
| ErrorMessage | string | This is error message. |
| Errors | Dictionary<string, object> | Set of errors in detail. |
| Header | HttpResponseHeaders | This is http response Header of REST request to Contentstack. |
| Message | string | This is error message. |
| ReasonPhrase | string | This is http response phrase code of REST request to Contentstack. |
| StatusCode | HttpStatusCode | This is http response status code of REST request to Contentstack. |
Asset
Assets refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded in your Contentstack repository for future use.
Create
The Upload asset request uploads an asset file to your stack.
| Name | Type | Description |
|---|---|---|
| model (required) | AssetModel | Asset Model with details. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
AssetModel model = new AssetModel("ASSET_NAME", "FILE_PATH", "FILE_CONTENT_TYPE");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Asset().Create(model);CreateAsync
The Upload asset request uploads an asset file to your stack.
| Name | Type | Description |
|---|---|---|
| model (required) | AssetModel | Asset Model with details. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
AssetModel model = new AssetModel("ASSET_NAME", "FILE_PATH", "FILE_CONTENT_TYPE");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Asset().CreateAsync(model);Delete
The Delete asset call will delete an existing asset from the stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>")..Asset("<ASSET_UID>").Delete();DeleteAsync
The Delete asset call will delete an existing asset from the stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>")..Asset("<ASSET_UID>").DeleteAsync();Fetch
The Get an asset call returns comprehensive information about a specific version of an asset of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>")..Asset("<ASSET_UID>").Fetch();FetchAsync
The Get an asset call returns comprehensive information about a specific version of an asset of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>")..Asset("<ASSET_UID>").FetchAsync();Folder
The Folder allows to fetch and create folders in assets.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional folder unique id. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Folder folder = client.Stack("<API_KEY>").Asset().Folder();Publish
The Publish an asset call is used to publish a specific version of an asset on the desired environment either immediately or at a later date/time.
| Name | Type | Description |
|---|---|---|
| details (required) | PublishUnpublishDetails | Publish details for publishing asset. |
| apiVersion | string | API version to pass in headers. Pass the value 3.2 to use latest Publish API. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishUnpublishDetails details = new PublishUnpublishDetails();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Asset("<ASSET_UID>").Publish(new PublishUnpublishDetails(), apiVersion: "3.2");
PublishAsync
The Publish an asset call is used to publish a specific version of an asset on the desired environment either immediately or at a later date/time.
| Name | Type | Description |
|---|---|---|
| details (required) | PublishUnpublishDetails | Publish details for publishing asset. |
| apiVersion | string | API version to pass in headers. Pass the value 3.2 to use latest publish API. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishUnpublishDetails details = new PublishUnpublishDetails();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Asset("<ASSET_UID>").PublishAsync(new PublishUnpublishDetails(), apiVersion: "3.2");Query
The Query on Asset will allow to fetch details of all Assets.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").Asset().Query();References
The References method retrieves the details of the entries and the content types in which the specified asset is referenced.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client
.Stack("<API_KEY>")
.Asset("<ASSET_UID>")
.References();ReferencesAsync
The ReferencesAsync method retrieves the details of the entries and the content types in which the specified asset is referenced.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client
.Stack("<API_KEY>")
.Asset("<ASSET_UID>")
.ReferencesAsync();Unpublish
The Unpublish an asset call is used to unpublish a specific version of an asset from a desired environment.
| Name | Type | Description |
|---|---|---|
| details (required) | PublishUnpublishDetails | Publish details for un-publishing asset. |
| apiVerison | string | API version to pass in headers. Pass the value 3.2 to use latest Unpublish API. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishUnpublishDetails details = new PublishUnpublishDetails();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Asset("<ASSET_UID>").Unpublish(new PublishUnpublishDetails(), apiVersion: "3.2");UnpublishAsync
The Unpublish an asset call is used to unpublish a specific version of an asset from a desired environment.
| Name | Type | Description |
|---|---|---|
| details (required) | PublishUnpublishDetails | Publish details for un-publishing asset. |
| apiVersion | string | API version to pass in headers. Pass the value 3.2 to use latest Unpublish API. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishUnpublishDetails details = new PublishUnpublishDetails();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Asset("<ASSET_UID>").UnpublishAsync(new PublishUnpublishDetails(), apiVersion: "3.2");Update
The Replace asset call will replace an existing asset with another file on the stack.
| Name | Type | Description |
|---|---|---|
| model (required) | AssetModel | Asset Model with details. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
AssetModel model = new AssetModel("ASSET_NAME", "FILE_PATH", "FILE_CONTENT_TYPE");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Asset("<ASSET_UID>").Update(model);UpdateAsync
The Replace asset call will replace an existing asset with another file on the stack.
| Name | Type | Description |
|---|---|---|
| model (required) | AssetModel | Asset Model with details. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
AssetModel model = new AssetModel("ASSET_NAME", "FILE_PATH", "FILE_CONTENT_TYPE");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Asset("<ASSET_UID>").UpdateAsync(model);Version
The Versioning on Asset will allow to fetch all version, delete specific version or naming the asset version.
| Name | Type | Description |
|---|---|---|
| versionNumber | int | Version number for the asset. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Version version = await client.Stack("<API_KEY>")..Asset("<ASSET_UID>").Version();Approvals
List of roles and list of user for the approval.
| Name | Type | Description |
|---|---|---|
| Roles | List<string> | List of roles for the approval |
| Users | List<string> | List of users for the approval. |
AssignRole
Roles for assigning for the organization/stack
| Name | Type | Description |
|---|---|---|
| Name | string | Role name. |
| Uid | string | Unique id for the role. |
AssignUser
User details for assigning for the organization/stack
| Name | Type | Description |
|---|---|---|
| string | User email address. | |
| Name | string | User name. |
| Uid | string | Unique id for the user. |
AuditLog
Audit log displays a record of all the activities performed in a stack and helps you keep a track of all published items, updates, deletes, and current status of the existing content.
Fetch
The Get audit log item request is used to retrieve a specific item from the audit log of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").AuditLog("<AUDITLOG_UID>").Fetch();FetchAsync
The Get audit log item request is used to retrieve a specific item from the audit log of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").AuditLog("<AUDITLOG_UID>").FetchAsync();FindAll
The Get audit log request is used to retrieve the audit log of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").AuditLog().FindAll();FindAllAsync
The Get audit log request is used to retrieve the audit log of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").AuditLog().FindAllAsync();ContentModelling
ContentModelling for creating/updating ContentTypes.
ContentModelling model = new ContentModelling(){
Title = " This is title ",
Uid = "The uid",
Schema = new List<Field>(){
new Field();
};
};| Name | Type | Description |
|---|---|---|
| Uid | string | UID for the content type. |
| Title | string | Title for the content type. |
| FieldRules | List<FieldRules> | List of field rules for the content type fields. |
| Options | Option | Option for the content types |
| Schema | List<Field> | Schema is list of the field you want to create within content type |
ContentType
Content type defines the structure or schema of a page or a section of your web or mobile property. To create content for your application, you are required to first create a content type, and then create entries using the content type.
Create
The Create a content type call creates a new content type in a particular stack of your Contentstack account.
| Name | Type | Description |
|---|---|---|
| model (required) | ContentModelling | ContentModelling for creating Content Type. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentModelling model = new ContentModelling();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType().Create(model);CreateAsync
The Create a content type call creates a new content type in a particular stack of your Contentstack account.
| Name | Type | Description |
|---|---|---|
| model (required) | ContentModelling | ContentModelling for creating Content Type. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentModelling model = new ContentModelling();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType().Create(model);Delete
The Delete Content Type call deletes an existing content type and all the entries within it.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Delete();DeleteAsync
The Delete Content Type call deletes an existing content type and all the entries within it.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").DeleteAsync();Fetch
The Fetch a single content type call returns information of a specific content type.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Fetch();FetchAsync
The Fetch a single content type call returns information of a specific content type.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").FetchAsync();Entry
Entry is the actual piece of content created using one of the defined content types.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional entry uid for performing entry specific operation. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry();Query
The Query on Content Type will allow to fetch details of all or specific Content Type.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").ContentType().Query();Update
The Update Content Type call is used to update the schema of an existing content type.
| Name | Type | Description |
|---|---|---|
| model (required) | ContentModelling | ContentModelling for updating Content Type. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentModelling model = new ContentModelling();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType().Create(model);UpdateAsync
The Update Content Type call is used to update the schema of an existing content type.
| Name | Type | Description |
|---|---|---|
| model (required) | ContentModelling | ContentModelling for updating Content Type. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentModelling model = new ContentModelling();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType().Create(model);VariantGroups
Find
The Find Variant Groups returns a list of all variant groups linked to your stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").VariantGroups().Find();FindAsync
The FindAsync Variant Groups returns a list of all variant groups linked to your stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").VariantGroups().Find();LinkContentTypes
The LinkContentTypes method allows you to link content types to your variant group.
| Name | Type | Description |
|---|---|---|
| contentTypeUids (required) | List<string> | List of content type UIDs to be linked to the variant group |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
List<string> contentTypeUids = new List<string> { "content_type_uid_1", "content_type_uid_2" };
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").VariantGroups("<VARIANT_GROUP_UID>").LinkContentTypes(contentTypeUids);LinkContentTypesAsync
The LinkContentTypesAsync method allows you to link content types to your variant group.
| Name | Type | Description |
|---|---|---|
| contentTypeUids (required) | List<string> | List of content type UIDs to be linked to the variant group |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
List<string> contentTypeUids = new List<string> { "content_type_uid_1", "content_type_uid_2" };
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").VariantGroups("<VARIANT_GROUP_UID>").LinkContentTypesAsync(contentTypeUids);UnlinkContentTypes
The UnlinkContentTypes method allows you to unlink content types to your variant group.
| Name | Type | Description |
|---|---|---|
| contentTypeUids (required) | List<string> | List of content type UIDs to be linked to the variant group |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
List<string> contentTypeUids = new List<string> { "content_type_uid_1", "content_type_uid_2" };
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").VariantGroups("<VARIANT_GROUP_UID>").UnlinkContentTypes(contentTypeUids);UnlinkContentTypesAsync
The UnlinkContentTypesAsync method allows you to unlink content types to your variant group.
| Name | Type | Description |
|---|---|---|
| contentTypeUids (required) | List<string> | List of content type UIDs to be linked to the variant group |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
List<string> contentTypeUids = new List<string> { "content_type_uid_1", "content_type_uid_2" };
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").VariantGroups("<VARIANT_GROUP_UID>").UnlinkContentTypesAsync(contentTypeUids);DeployModel
Assets/Entries deploy model
| Name | Type | Description |
|---|---|---|
| Action | string | Deploy action the the entry. |
| Environments | List<string> | Environment on which deploy assets/entries. |
| Locales | List<string> | List of locales for deployment. |
| ScheduledAt | string | Set date for future deployment. |
Entry
An entry is an actual piece of content that you want to publish. You can create entries only for content types that have already been created.
Create
The Create an entry call creates a new entry for the selected content type.
| Name | Type | Description |
|---|---|---|
| model (required) | IEntry | IEntry for creating entry. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core.Abstractions;
using Newtonsoft.Json;
namespace TestModels
{
public class EntryModel : IEntry
{
public EntryModel()
{
}
[JsonProperty(propertyName: "title")]
public string Title { get; set; }
[JsonProperty(propertyName: "url")]
public string URL { get; set; }
[JsonProperty(propertyName: "uid")]
public string Uid { get; set; }
}
}Next, you need to set the data to the model. Here’s how you can do that:
EntryModel entryModel = new EntryModel()
{
Title = "Your Entry Title",
URL = "path/yoururl.com/example",
};The code below illustrates how to create an entry:
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EntryModel model = new EntryModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry().Create(model);CreateAsync
The Create an entry call creates a new entry for the selected content type.
| Name | Type | Description |
|---|---|---|
| model (required) | IEntry | IEntry for creating entry. |
| collection | ParameterCollection | Query parameter collection |
To create an entry, you need to prepare a custom model class that represents the entry's request body. To do so, create a separate EntryModel.cs file and add your custom EntryModel class, implementing IEntry interface, as follows:
using Contentstack.Management.Core.Abstractions;
using Newtonsoft.Json;
namespace TestModels
{
public class EntryModel : IEntry
{
public EntryModel()
{
}
[JsonProperty(propertyName: "title")]
public string Title { get; set; }
[JsonProperty(propertyName: "url")]
public string URL { get; set; }
[JsonProperty(propertyName: "uid")]
public string Uid { get; set; }
}
}Next, you need to set the data to the model. Here’s how you can do that:
EntryModel entryModel = new EntryModel()
{
Title = "Your Entry Title",
URL = "path/yoururl.com/example",
};The code below illustrates how to update an entry
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EntryModel model = new EntryModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry().CreateAsync(model);Delete
The Delete Entry call deletes an existing entry and all the entries within it.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Delete();DeleteAsync
The Delete Entry call deletes an existing entry and all the entries within it.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").DeleteAsync();DeleteMultipleLocal
The Delete Locale will delete specific localized entries by passing the locale codes.
| Name | Type | Description |
|---|---|---|
| locales | List<string> | Enter the code of the language to unlocalize the entry of that particular language. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
List<string> locales = new List<string>();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").DeleteMultipleLocal(locales);DeleteMultipleLocalAsync
The Delete Locale will delete specific localized entries by passing the locale codes.
| Name | Type | Description |
|---|---|---|
| locales | List<string> | Enter the code of the language to unlocalize the entry of that particular language. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
List<string> locales = new List<string>();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").DeleteMultipleLocalAsync(locales);Export
The Export an entry call is used to export an entry. The exported entry data is saved in a downloadable JSON file.
| Name | Type | Description |
|---|---|---|
| filePath (required) | string | Path to file you want to export entry. |
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Export("PATH/TO/FILE");Fetch
The Fetch a single entry call returns information of a specific content type.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Fetch();FetchAsync
The Fetch a single entry call returns information of a specific content type.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").FetchAsync();Import
The Import an entry call is used to import an entry. To import an entry, you need to upload a JSON file that has entry data in the format that fits the schema of the content type it is being imported to.
| Name | Type | Description |
|---|---|---|
| filePath (required) | string | Path to file you want to import. |
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Import("PATH/TO/FILE");ImportAsync
The Import an entry call is used to import an entry. To import an entry, you need to upload a JSON file that has entry data in the format that fits the schema of the content type it is being imported to.
| Name | Type | Description |
|---|---|---|
| filePath (required) | string | Path to file you want to import. |
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").ImportAsync("PATH/TO/FILE");Locales
The Get languages of an entry call returns the details of all the languages that an entry exists in.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Locales();LocalesAsync
The Get languages of an entry call returns the details of all the languages that an entry exists in.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").LocalesAsync();Localize
The Localize an entry request allows you to localize an entry i.e., the entry will cease to fetch data from its fallback language and possess independent content specific to the selected locale.
| Name | Type | Description |
|---|---|---|
| model (required) | IEntry | Localized IEntry model. |
| locale | string | Enter the code of the language to unlocalize the entry of that particular language. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EntryModel model = new EntryModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Localize(model, "hi-in");LocalizeAsync
The Localize an entry request allows you to localize an entry i.e., the entry will cease to fetch data from its fallback language and possess independent content specific to the selected locale.
| Name | Type | Description |
|---|---|---|
| model (required) | IEntry | Localized IEntry model. |
| locale | string | Enter the code of the language to unlocalize the entry of that particular language. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EntryModel model = new EntryModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").LocalizeAsync(model, "hi-in");Publish
The Publish an entry request lets you publish an entry either immediately or schedule it for a later date/time.
| Name | Type | Description |
|---|---|---|
| details (required) | PublishUnpublishDetails | Publish details for publishing entry. |
| locale | string | Locale for which entry to be published. |
| apiVersion | string | API version to pass in headers. Pass the value 3.2 to use latest Publish API. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishUnpublishDetails details = new PublishUnpublishDetails();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Publish(details, "en-us", apiVersion: "3.2");PublishAsync
The Publish an entry request lets you publish an entry either immediately or schedule it for a later date/time.
| Name | Type | Description |
|---|---|---|
| details (required) | PublishUnpublishDetails | Publish details for publishing entry. |
| locale | string | Locale for which entry to be published. |
| apiVersion | string | API version to pass in headers. Pass the value 3.2 to use latest Publish API. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishUnpublishDetails details = new PublishUnpublishDetails();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").PublishAsync(details, "en-us", apiVersion: "3.2");PublishRequest
This multipurpose request allows you to either send a publish request or accept/reject a received publish request.
| Name | Type | Description |
|---|---|---|
| action (required) | EntryPublishAction | EntryPublishAction for setting entry to publish request. |
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EntryPublishAction model = new EntryPublishAction();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").PublishRequest(model);PublishRequestAsync
This multipurpose request allows you to either send a publish request or accept/reject a received publish request.
| Name | Type | Description |
|---|---|---|
| action (required) | EntryPublishAction | EntryPublishAction for setting entry to publish request. |
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EntryPublishAction model = new EntryPublishAction();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").PublishRequestAsync(model);Query
The Query on Entry will allow to fetch details of all or specific Content Type.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry().Query();References
The Get references of an entry call returns all the entries of content types that are referenced by a particular entry.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").References();ReferencesAsync
The Get references of an entry call returns all the entries of content types that are referenced by a particular entry.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").ReferencesAsync();SetWorkflow
The Set Entry Workflow Stage request allows you to either set a particular workflow stage of an entry or update the workflow stage details of an entry.
| Name | Type | Description |
|---|---|---|
| model (required) | EntryWorkflowStage | EntryWorkflowStage object for setting entry to workflow stage. |
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EntryWorkflowStage model = new EntryWorkflowStage();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").SetWorkflow(model);SetWorkflowAsync
The Set Entry Workflow Stage request allows you to either set a particular workflow stage of an entry or update the workflow stage details of an entry.
| Name | Type | Description |
|---|---|---|
| model (required) | EntryWorkflowStage | EntryWorkflowStage object for setting entry to workflow stage. |
| collection | ParameterCollection | Query parameter. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EntryWorkflowStage model = new EntryWorkflowStage();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").SetWorkflowAsync(model);Unlocalize
The Unlocalize an entry request is used to unlocalize an existing entry.
| Name | Type | Description |
|---|---|---|
| locale | string | Enter the code of the language to unlocalize the entry of that particular language. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Unlocalize("hi-in");UnlocalizeAsync
The Unlocalize an entry request is used to unlocalize an existing entry.
| Name | Type | Description |
|---|---|---|
| locale | string | Enter the code of the language to unlocalize the entry of that particular language. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").UnlocalizeAsync("hi-in");Unpublish
The Unpublish an entry call will unpublish an entry at once, and also, gives you the provision to unpublish an entry automatically at a later date/time.
| Name | Type | Description |
|---|---|---|
| details (required) | PublishUnpublishDetails | Publish details for un-publishing entry. |
| locale | string | Locale for which entry to be un-published. |
| apiVersion | string | API version to pass in headers. Pass the value 3.2 to use latest Unpublish API. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishUnpublishDetails details = new PublishUnpublishDetails();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Unpublish(details, "en-us", apiVersion: "3.2");UnpublishAsync
The Unpublish an entry call will unpublish an entry at once, and also, gives you the provision to unpublish an entry automatically at a later date/time.
| Name | Type | Description |
|---|---|---|
| details (required) | PublishUnpublishDetails | Publish details for un-publishing entry. |
| locale | string | Locale for which entry to be un-published. |
| apiVersion | string | API version to pass in headers. Pass the value 3.2 to use latest Unpublish API. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishUnpublishDetails details = new PublishUnpublishDetails();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").UnpublishAsync(details, "en-us", apiVersion: "3.2");Update
The Update Entry call is used to update the content of an existing entry.
| Name | Type | Description |
|---|---|---|
| model (required) | IEntry | IEntry for updating entry. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EntryModel model = new EntryModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("ENTRY_UID").Update(model);UpdateAsync
The Update Entry call is used to update the content of an existing entry.
| Name | Type | Description |
|---|---|---|
| model (required) | IEntry | IEntry for updating entry. |
| collection | ParameterCollection | Query parameter collection |
To update an entry, you need to prepare a custom model class that represents the entry's request body. To do so, create a separate EntryModel.cs file and add your custom EntryModel class, implementing IEntry interface, as follows:
using Contentstack.Management.Core.Abstractions;
using Newtonsoft.Json;
namespace TestModels
{
public class EntryModel : IEntry
{
public EntryModel()
{
}
[JsonProperty(propertyName: "title")]
public string Title { get; set; }
[JsonProperty(propertyName: "url")]
public string URL { get; set; }
[JsonProperty(propertyName: "uid")]
public string Uid { get; set; }
}
}Next, you need to set the data to the model. Here’s how you can do that:
EntryModel entryModel = new EntryModel()
{
Title = "Your Entry Title",
URL = "path/yoururl.com/example",
};The code below illustrates how to update an entry
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EntryModel model = new EntryModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("ENTRY_UID").UpdateAsync(model);Version
The Version on Entry will allow to fetch all version, delete specific version or naming the asset version.
| Name | Type | Description |
|---|---|---|
| versionNumber | int | Version number for the entry. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Version version = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry().Version();EntryPublishAction
Publish action for the entry release.
| Name | Type | Description |
|---|---|---|
| Action | string | Publish action the the entry. |
| Comment | string | Comment for the publish action. |
| Status | int | Status for the publish action. |
| Notify | bool | Set true to notify the action details. |
| Uid | string | Publish action uid. |
EntryWorkflowStage
A workflow lets you manage the stages through which your content will move in the content creation process.
| Name | Type | Description |
|---|---|---|
| AssignedByRoles | List<AssignRole> | List of assigned roles for the workflow stage. |
| AssignedTo | List<AssignUser> | List of users assigned to the workflow stage. |
| Comment | string | Comment for the workflow stage. |
| DueDate | string | Due date for the workflow stage. |
| Notify | bool | Set true to notify the workflow users. |
| Uid | string | Workflow stage uid. |
Environment
An environment allows users to publish their content on the destination URL. After you create an entry, you will publish it on an environment. After publishing, you will see the content on your website’s URL (specified in the environment). Being not limited to a single environment, you can publish content on multiple environments too.
Create
The Create function will add a publishing environment for a stack.
| Name | Type | Description |
|---|---|---|
| model (required) | EnvironmentModel | Environment model for updating the environment. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EnvironmentModel model = new EnvironmentModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Environment().Create(model);CreateAsync
The Create function will add a publishing environment for a stack.
| Name | Type | Description |
|---|---|---|
| model (required) | EnvironmentModel | Environment model for updating the environment. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EnvironmentModel model = new EnvironmentModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Environment().CreateAsync(model);Delete
The Delete function will delete an existing publishing environment from your stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Environment("<EXTENSION_UID>").Delete();DeleteAsync
The Delete function will delete an existing publishing environment from your stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Environment("<EXTENSION_UID>").DeleteAsync();FetchAsync
The Fetch function returns more details about the specified environment of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Environment("<EXTENSION_UID>").Fetch();FetchAsync
The Fetch function returns more details about the specified environment of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Environment("<EXTENSION_UID>").FetchAsync();Query
The Query on Environment function fetches the list of all environments available in a stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").Environment().Query();Update
The Update function will update the details of an existing publishing environment for a stack.
| Name | Type | Description |
|---|---|---|
| model (required) | EnvironmentModel | Environment model for updating the environment. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EnvironmentModel model = new EnvironmentModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Environment("<ENVIRONMENT_UID>").Update(model);UpdateAsync
The Update function will update the details of an existing publishing environment for a stack.
| Name | Type | Description |
|---|---|---|
| model (required) | EnvironmentModel | Environment model for updating the environment. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
EnvironmentModel model = new EnvironmentModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Environment("<ENVIRONMENT_UID>").UpdateAsync(model);EnvironmentModel
Environment model for creating or updating the environment.
| Name | Type | Description |
|---|---|---|
| DeployContent | bool | Set true to deploying the content for the environment. |
| Name | string | Name for the environment. |
| Servers | List<Server> | List of servers for the Environment. |
| Urls | List<LocalesUrl> | List of locale urls for the environment. |
Extension
Extensions let you create custom fields and custom widgets that lets you customize Contentstack default UI and behavior.
Create
The Create is used to create a custom field, custom-widget, dashboard widget to the Stack.
| Name | Type | Description |
|---|---|---|
| model (required) | ExtensionModel | Extension model for creating the Extension. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ExtensionModel model = new ExtensionModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Extension().Create(model);CreateAsync
The Create is used to create a custom field, custom-widget, dashboard widget to the Stack.
| Name | Type | Description |
|---|---|---|
| model (required) | ExtensionModel | Extension model for creating the Extension. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ExtensionModel model = new ExtensionModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Extension().CreateAsync(model);Delete
The Delete extension call will delete an existing extension from the stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Extension("<EXTENSION_UID>").Delete();DeleteAsync
The Delete extension call will delete an existing extension from the stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Extension("<EXTENSION_UID>").DeleteAsync();Fetch
The Get an extension call returns comprehensive information about a specific extension of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Extension("<EXTENSION_UID>").Fetch();FetchAsync
The Get an extension call returns comprehensive information about a specific extension of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Extension("<EXTENSION_UID>").FetchAsync();Query
The Query on Extension will allow to fetch details of all Extensions.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").Extension().Query();Update
The Update extension call will update an existing extension on the stack.
| Name | Type | Description |
|---|---|---|
| model (required) | ExtensionModel | Extension model for updating the Extension. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ExtensionModel model = new ExtensionModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Extension("<EXTENSION_UID>").Update(model);UpdateAsync
The Update extension call will update an existing extension on the stack.
| Name | Type | Description |
|---|---|---|
| model (required) | ExtensionModel | Extension model for updating the Extension. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ExtensionModel model = new ExtensionModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Extension("<EXTENSION_UID>").UpdateAsync(model);Upload
The Upload request is used to upload a new custom-field, custom-widget, dashboard widget to the Stack.
| Name | Type | Description |
|---|---|---|
| model (required) | IExtensionInterface | IExtensionInterface with details for uploading the extension. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
CustomFieldModel model = new CustomFieldModel("FILE_PATH", "FILE_CONTENT_TYPE", "TITLE", "DATA_TYPE");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Extension().Upload(model);UploadAsync
The Upload request is used to upload a new custom-field, custom-widget, dashboard widget to the Stack.
| Name | Type | Description |
|---|---|---|
| model (required) | IExtensionInterface | IExtensionInterface with details for uploading the extension. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
CustomFieldModel model = new CustomFieldModel("FILE_PATH", "FILE_CONTENT_TYPE", "TITLE", "DATA_TYPE");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Extension().UploadAsync(model);ExtensionModel
Extension model for creating or updating extensions.
| Name | Type | Description |
|---|---|---|
| Config (required) | string | Config for the extension. |
| DataType | string | DataType for the extension. |
| Multiple | bool | Set true for multiple extension. |
| Scope | ExtensionScope | Scope for the extension. |
| Src | string | Source code for the extension. |
| Srcdoc | string | Doc for the extension. |
| Tags | List<string> | List of tags to be added to extension. |
| Title | string | Extension title for giving name to extension. |
| Type | string | Extension type like custom field, widget, or dashboard. |
ExtensionScope
Scope model for adding scope to the extensions.
| Name | Type | Description |
|---|---|---|
| ContentTypes (required) | List<string> | List of content type for extension scope |
Folder
Model to create or update label.
Create
The Create a folder call is used to create an asset folder and/or add a parent folder to it.
| Name | Type | Description |
|---|---|---|
| name (required) | string | Name for folder to be updated to. |
| parentUid | string | Parent uid for the folder to be moved. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Asset().Folder().Create("<FOLDER_NAME>");CreateAsync
The Create a folder call is used to create an asset folder and/or add a parent folder to it.
| Name | Type | Description |
|---|---|---|
| name (required) | string | Name for folder to be updated to. |
| parentUid | string | Parent uid for the folder to be moved. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Asset().Folder().CreateAsync("<FOLDER_NAME>");Delete
The Delete a folder call is used to delete an asset folder along with all the assets within that folder.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Asset().Folder("<ASSET_UID>").Delete(model);DeleteAsync
The Delete a folder call is used to delete an asset folder along with all the assets within that folder.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Asset().Folder("<ASSET_UID>").DeleteAsync(model);Fetch
The Get a single folder call gets the comprehensive details of a specific asset folder by means of folder UID.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Asset().Folder("<ASSET_UID>").Fetch(model);FetchAsync
The Get a single folder call gets the comprehensive details of a specific asset folder by means of folder UID.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Asset().Folder("<ASSET_UID>").FetchAsync(model);Update
The Update or move folder request can be used either to update the details of a folder or set the parent folder if you want to move a folder under another folder.
| Name | Type | Description |
|---|---|---|
| name (required) | string | Name for folder to be updated to. |
| parentUid | string | Parent uid for the folder to be moved. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Asset().Folder("<ASSET_UID>").Update("<FOLDER_NAME>");UpdateAsync
The Update or move folder request can be used either to update the details of a folder or set the parent folder if you want to move a folder under another folder.
| Name | Type | Description |
|---|---|---|
| name (required) | string | Name for folder to be updated to. |
| parentUid | string | Parent uid for the folder to be moved. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Asset().Folder("<ASSET_UID>").UpdateAsync("<FOLDER_NAME>");GlobalField
You can define a Global Field as a reusable field (or a group of fields) that you define once and use in any content type within your stack.
Note To enable nested global fields, pass api_version: 3.2 when initializing the Global Field object.
Create
The Create global field with JSON RTE request shows you how to add a JSON RTE field while creating a global field.
| Name | Type | Description |
|---|---|---|
| model (required) | ContentModelling | Content Model for updating GlobalField. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentModeling model = new ContentModeling();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").GlobalField().Create(model);CreateAsync
The Create global field with JSON RTE request shows you how to add a JSON RTE field while creating a global field.
| Name | Type | Description |
|---|---|---|
| model (required) | ContentModelling | Content Model for updating GlobalField. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentModeling model = new ContentModeling();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").GlobalField().CreateAsync(model);Delete
The Delete Content Type call deletes an existing global field and all the entries within it.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").GlobalField("<GLOBAL_FIELD_UID>").Delete();DeleteAsync
The Delete Content Type call deletes an existing global field and all the entries within it.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").GlobalField("<GLOBAL_FIELD_UID>").DeleteAsync();Fetch
The Fetch a single global fieldcall returns information of a specific global field.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").GlobalField("<GLOBAL_FIELD_UID>").Fetch();FetchAsync
The Fetch a single global fieldcall returns information of a specific global field.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").GlobalField("<GLOBAL_FIELD_UID>").FetchAsync();Query
The Query on Global Field will allow to fetch details of all or specific Content Type.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").GlobalField().Query();Update
The Update Content Type call is used to update the schema of an existing global field.
| Name | Type | Description |
|---|---|---|
| model (required) | ContentModelling | Content Model for updating GlobalField. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentModeling model = new ContentModeling();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").GlobalField("<GLOBAL_FIELD_UID>").Update(model);UpdateAsync
The Update Content Type call is used to update the schema of an existing global field.
| Name | Type | Description |
|---|---|---|
| model (required) | ContentModelling | Content Model for updating GlobalField. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentModeling model = new ContentModeling();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").GlobalField("<GLOBAL_FIELD_UID>").UpdateAsync(model);Label
Labels are similar to folders that allow increased flexibility over your Content Types. Labels allow you to categorize and organize the existing content types of your stack.
Create
The Create used to create a label.
| Name | Type | Description |
|---|---|---|
| model (required) | LabelMode | Label Model for updating label. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
LabelMode model = new LabelMode();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Label().Create(model);CreateAsync
The Create used to create a label.
| Name | Type | Description |
|---|---|---|
| model (required) | LabelMode | Label Model for updating label. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
LabelMode model = new LabelMode();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Label().CreateAsync(model);Delete
The Delete label call is used to delete a specific label.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Label("<LABEL_UID>").Delete();DeleteAsync
The Delete label call is used to delete a specific label.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Label("<LABEL_UID>").DeleteAsync();Fetch
The Fetch a single label call returns information about a particular label of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Label("<LABEL_UID>").Fetch();FetchAsync
The Fetch a single label call returns information about a particular label of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Label("<LABEL_UID>").FetchAsync();Query
The Query on Label This call fetches all the existing labels of the stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").Label().Query();Update
The Update label call is used to update an existing label.
| Name | Type | Description |
|---|---|---|
| model (required) | LabelMode | Label Model for updating label. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
LabelMode model = new LabelMode();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Label("<LABEL_UID>").Update(model);UpdateAsync
The Update label call is used to update an existing label.
| Name | Type | Description |
|---|---|---|
| model (required) | LabelMode | Label Model for updating label. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
LabelMode model = new LabelMode();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Label("<LABEL_UID>").UpdateAsync(model);LabelModel
Model to create or update label.
| Name | Type | Description |
|---|---|---|
| ContentTypes (required) | List<string> | List of content type to be added in label. |
| Name | string | Name for the Label to be created/updated. |
| Parent | List<string> |
Locale
CreateAsync
This call lets you add a new language to your stack. You can either add a supported language or a custom language of your choice.
| Name | Type | Description |
|---|---|---|
| model (required) | LocaleModel | Locale Model for creating locale. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
LocaleModel model = new LocaleModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Locale().CreateAsync(model);Delete
The Delete language call deletes an existing language from your stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Locale("<LOCALE_CODE>").Delete();DeleteAsync
The Delete language call deletes an existing language from your stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Locale("<LOCALE_CODE>").DeleteAsync();Fetch
The Get a language call returns information about a specific language available on the stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Locale("<LOCALE_CODE>").Fetch();FetchAsync
The Get a language call returns information about a specific language available on the stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Locale("<LOCALE_CODE>").FetchAsync();Query
The Query on locale allow to get the list of all languages (along with the language codes) available for a stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").Locale().Query();Update
The Update language call will let you update the details (such as display name) and the fallback language of an existing language of your stack.
| Name | Type | Description |
|---|---|---|
| model (required) | LocaleModel | Locale Model for creating locale. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
LocaleModel model = new LocaleModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Locale("LOCALE_CODE>").Update(model);UpdateAsync
The Update language call will let you update the details (such as display name) and the fallback language of an existing language of your stack.
| Name | Type | Description |
|---|---|---|
| model (required) | LocaleModel | Locale Model for creating locale. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
LocaleModel model = new LocaleModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Locale("LOCALE_CODE>").UpdateAsync(model);LocaleModel
| Name | Type | Description |
|---|---|---|
| Name | string | Locale Name |
| Code | string | Locale code for creating or updating the locale |
| FallbackLocale | string | Fallback locale to fallback when entry is not present in current locale |
LocalesUrl
| Name | Type | Description |
|---|---|---|
| Locale | string | |
| Url | string |
Option
| Name | Type | Description |
|---|---|---|
| IsPage | bool | |
| Singleton | bool | |
| SubTitle | List<string> | |
| Title | string | |
| UrlPattern | string | |
| UrlPrefix | string |
Organization
Organization is the top-most entity in the hierarchy of entities in Contentstack. Users, stacks—and consequently, the resources within the stacks—are part of an Organization. As a result, an Organization lets you manage users and stacks from one administrative panel.
AddUser
The Add users to organization call allows you to send invitations to add users to your organization. Only the owner or the admin of the organization can add users.
| Name | Type | Description |
|---|---|---|
| orgInvite (required) | List<UserInvitation> | List of User invitation. |
| stackInvite | Dictionary<string, List<UserInvitation>> | Stack Uid with user invitation details. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
UserInvitation invitation = new UserInvitation()
{
Email = "<EMAIL>",
Roles = new System.Collections.Generic.List<string>() { "<ROLE_UID>" }
};
ContentstackResponse contentstackResponse = client.Organization("<ORG_UID>")
.AddUser(
new System.Collections.Generic.List<UserInvitation>()
{
invitation
},
new Dictionary<string, List<UserInvitation>> ()
{
"<STACK_UID>"= invitation
}
);AddUserAsync
The Add users to organization call allows you to send invitations to add users to your organization. Only the owner or the admin of the organization can add users.
| Name | Type | Description |
|---|---|---|
| orgInvite (required) | List<UserInvitation> | List of User invitation. |
| stackInvite | Dictionary<string, List<UserInvitation>> | Stack Uid with user invitation details. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
UserInvitation invitation = new UserInvitation()
{
Email = "<EMAIL>",
Roles = new System.Collections.Generic.List<string>() { "<ROLE_UID>" }
};
ContentstackResponse contentstackResponse = await client.Organization("<ORG_UID>")
.AddUserAsync(
new System.Collections.Generic.List<UserInvitation>()
{
invitation
},
new Dictionary<string, List<UserInvitation>> ()
{
"<STACK_UID>"= invitation
}
);GetInvitations
The Get all organization invitations call gives you a list of all the Organization invitations.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query Parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Organization("<ORG_UID>").GetInvitations();GetInvitationsAsync
The Get all organization invitations call gives you a list of all the Organization invitations.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query Parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Organization("<ORG_UID>").GetInvitationsAsync();GetOrganizations
The Get all/single organizations call lists all organizations related to the system user in the order that they were created.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query Parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Organization().GetOrganizations();GetOrganizationsAsync
The Get all/single organizations call lists all organizations related to the system user in the order that they were created.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query Parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Organization().GetOrganizationsAsync();GetStacks
The get Stacks call gets all the Stack within the Organization.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query Parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Organization("<ORG_UID>").GetStacks();GetStacksAsync
The get Stacks call gets all the Stack within the Organization.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query Parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Organization("<ORG_UID>").GetStacksAsync();RemoveUser
The Remove users from organization request allows you to remove existing users from your organization.
| Name | Type | Description |
|---|---|---|
| emails | List<string> | List of emails to be remove from the Organization. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Organization("<ORG_UID>").RemoveUser(new List() { "<EMAIL>" });RemoveUserAsync
The Remove users from organization request allows you to remove existing users from your organization.
| Name | Type | Description |
|---|---|---|
| emails | List<string> | List of emails to be remove from the Organization. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Organization("<ORG_UID>").RemoveUserAsync(new List() { "<EMAIL>" });ResendInvitation
The Resend pending organization invitation call allows you to resend Organization invitations to users who have not yet accepted the earlier invitation. Only the owner or the admin of the Organization can resend the invitation to add users to an Organization.
| Name | Type | Description |
|---|---|---|
| shareUid | string | Uid for share invitation send to user. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Organization("<ORG_UID>").ResendInvitation("<SHARE_UID>");ResendInvitationAsync
The Resend pending organization invitation call allows you to resend Organization invitations to users who have not yet accepted the earlier invitation. Only the owner or the admin of the Organization can resend the invitation to add users to an Organization.
| Name | Type | Description |
|---|---|---|
| shareUid | string | Uid for share invitation send to user. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Organization("<ORG_UID>").ResendInvitationAsync("<SHARE_UID>");Roles
The Get all roles in an organization call gives the details of all the roles that are set to users in an Organization.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query Parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Organization("<ORG_UID>").Roles();RolesAsync
The Get all roles in an organization call gives the details of all the roles that are set to users in an Organization.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query Parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Organization("<ORG_UID>").RolesAsync();TransferOwnership
The Transfer organization ownership call transfers the ownership of an Organization to another user.
| Name | Type | Description |
|---|---|---|
| string | The email id of user for transfer. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Organization("<ORG_UID>").TransferOwnership("<EMAIL>");TransferOwnershipAsync
The Transfer organization ownership call transfers the ownership of an Organization to another user.
| Name | Type | Description |
|---|---|---|
| string | The email id of user for transfer. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Organization("<ORG_UID>").TransferOwnershipAsync("<EMAIL>");PublishQueue
When the Content Manager publishes an entry and/or asset, the system puts the action into a publish queue. Publish/unpublish activities in this queue are performed one at a time, almost at a high speed.
Cancel
The Cancel Scheduled Action request will allow you to cancel any scheduled publishing or unpublishing activity of entries and/or assets and also cancel the deployment of releases.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").PublishQueue("<PUBLISH_QUEUE_UID>").Cancel();CancelAsync
The Cancel Scheduled Action request will allow you to cancel any scheduled publishing or unpublishing activity of entries and/or assets and also cancel the deployment of releases.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").PublishQueue("<PUBLISH_QUEUE_UID>").CancelAsync();Fetch
The Get publish queue activity request returns comprehensive information on a specific publish, unpublish, or delete action that was performed on an entry and/or asset. You can also retrieve details of a specific release deployment.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").PublishQueue("<PUBLISH_QUEUE_UID>").Fetch();FetchAsync
The Get publish queue activity request returns comprehensive information on a specific publish, unpublish, or delete action that was performed on an entry and/or asset. You can also retrieve details of a specific release deployment.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").PublishQueue("<PUBLISH_QUEUE_UID>").FetchAsync();FindAll
The Get publish queue request returns comprehensive information on activities such as publish, unpublish, and delete that have performed on entries and/or assets. This request also includes the details of the release deployments in the response body.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").PublishQueue().FindAll();FindAllAsync
The Get publish queue request returns comprehensive information on activities such as publish, unpublish, and delete that have performed on entries and/or assets. This request also includes the details of the release deployments in the response body.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").PublishQueue().FindAllAsync();PublishRule
Publish Rules are conditions that you define for your content publishing. It allows you to govern whether entries can be published with or without someone’s approval or only when the content is at a particular stage.
Create
The Create Publish Rules request allows you to create publish rules for the workflow of a stack.
| Name | Type | Description |
|---|---|---|
| model (required) | PublishRuleModel | PublishRule Model for creating rule. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishRuleModel model = new PublishRuleModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().PublishRule().CreateAsync(model);CreateAsync
The Create Publish Rules request allows you to create publish rules for the workflow of a stack.
| Name | Type | Description |
|---|---|---|
| model (required) | PublishRuleModel | PublishRule Model for creating rule. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishRuleModel model = new PublishRuleModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().PublishRule().CreateAsync(model);Delete
The Delete Publish Rules request allows you to delete an existing publish rule.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().PublishRule("<PUBLISH_RULE_UID>").Delete();DeleteAsync
The Delete Publish Rules request allows you to delete an existing publish rule.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().PublishRule("<PUBLISH_RULE_UID>").DeleteAsync();Fetch
The fetch Publish Rule request retrieves the comprehensive details of a specific publish rule of a Workflow.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().PublishRule("<PUBLISH_RULE_UID>").Fetch();FetchAsync
The fetch Publish Rule request retrieves the comprehensive details of a specific publish rule of a Workflow.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().PublishRule("<PUBLISH_RULE_UID>").FetchAsync();FindAll
The Get all Publish Rules request retrieves the details of all the Publish rules of a workflow.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().PublishRule().FindAll();FindAllAsync
The Get all Publish Rules request retrieves the details of all the Publish rules of a workflow.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().PublishRule().FindAllAsync();Update
The Update Publish Rules request allows you to add a publish rule or update the details of the existing publish rules of a workflow.
| Name | Type | Description |
|---|---|---|
| model (required) | PublishRuleModel | PublishRule Model for updating Content Type. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishRuleModel model = new PublishRuleModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().PublishRule("<PUBLISH_RULE_UID>").Update(model);UpdateAsync
The Update Publish Rules request allows you to add a publish rule or update the details of the existing publish rules of a workflow.
| Name | Type | Description |
|---|---|---|
| model (required) | PublishRuleModel | PublishRule Model for updating Content Type. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishRuleModel model = new PublishRuleModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().PublishRule("<PUBLISH_RULE_UID>").UpdateAsync(model);PublishRuleModel
Set rules for publishing entry/asset.
| Name | Type | Description |
|---|---|---|
| Actions (required) | List<string> | Set list action for publishing rules. |
| Approvers (required) | Approvals | Approval details for publish rule |
| Branches | List<string> | List of branches for the publish rule to be applied. |
| ContentTypes | List<string> | List of content types the publish rule to be applied. |
| DisableApproval | bool | Set true to disable approvals. |
| Environment | string | Set environment for the publish rule |
| Locale | string | Set locale for the publish rules. |
| WorkflowStageUid | string | Set workflow stage uid for the publish rules. |
| WorkflowUid | string | Set workflow uid for the publish rules. |
PublishUnpublishDetails
Publish rule details for publish or un-publish entry or asset
| Name | Type | Description |
|---|---|---|
| Environments (required) | List<string> | List of environment for publishing/un-publishing entry/asset. |
| Locales (required) | List<string> | List of locales for the publish details. |
| ScheduledAt | string | Set date time for scheduling the publish/un-publish. |
| Version | string | Set specific version for publish/un-publish. |
Release
You can define a “Release” as a set of entries and assets that needs to be deployed (published or unpublished) all at once to a particular environment.
Clone
The Clone request allows you to clone (make a copy of) a specific Release in a stack.
| Name | Type | Description |
|---|---|---|
| name (required) | string | Name for the release to be cloned. |
| description | string | Description for the release to be cloned. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Release("<RELEASE_UID>").Clone("<NAME>", "<DESCRIPTION>");CloneAsync
The Clone request allows you to clone (make a copy of) a specific Release in a stack.
| Name | Type | Description |
|---|---|---|
| name (required) | string | Name for the release to be cloned. |
| description | string | Description for the release to be cloned. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Release("<RELEASE_UID>").CloneAsync("<NAME>", "<DESCRIPTION>");Create
The Create request allows you to create a new Release in your stack. To add entries/assets to a Release, you need to provide the UIDs of the entries/assets in ‘items’ in the request body.
| Name | Type | Description |
|---|---|---|
| model (required) | ReleaseModel | Release Model for creating ReleaseModel. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ReleaseModel model = new ReleaseModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Release().Create(model);CreateAsync
The Create request allows you to create a new Release in your stack. To add entries/assets to a Release, you need to provide the UIDs of the entries/assets in ‘items’ in the request body.
| Name | Type | Description |
|---|---|---|
| model (required) | ReleaseModel | Release Model for creating ReleaseModel. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ReleaseModel model = new ReleaseModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Release().CreateAsync(model);Delete
The Delete request allows you to delete a specific Release from a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Release("<RELEASE_UID>").Delete();DeleteAsync
The Delete request allows you to delete a specific Release from a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Release("<RELEASE_UID>").DeleteAsync();Deploy
The Fetch request gets the details of a specific Release in a stack.
| Name | Type | Description |
|---|---|---|
| model | DeployModel | DeployModel details to deploy the release. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
DeployModel model = new DeployModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Release("<RELEASE_UID>").Deploy(model);;DeployAsync
The Fetch request gets the details of a specific Release in a stack.
| Name | Type | Description |
|---|---|---|
| model | DeployModel | DeployModel details to deploy the release. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
DeployModel model = new DeployModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Release("<RELEASE_UID>").DeployAsync(model);;Fetch
The Fetch request gets the details of a specific Release in a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Release("<RELEASE_UID>").Fetch();FetchAsync
The Fetch request gets the details of a specific Release in a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Release("<RELEASE_UID>").FetchAsync();Item
The list of all items (entries and assets) that are part of a specific Release.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ReleaseItem item = client.Stack("<API_KEY>").Release("<RELEASE_UID>").Item();Query
The Query on ReleaseModel request retrieves a list of all Releases of a stack along with details of each Release.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").Release().Query();Update
The Update call allows you to update the details of a Release, i.e., the ‘name’ and ‘description’.
| Name | Type | Description |
|---|---|---|
| model (required) | ReleaseModel | Release Model for creating ReleaseModel. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ReleaseModel model = new ReleaseModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Release("<RELEASE_UID>").Update(model);UpdateAsync
The Update call allows you to update the details of a Release, i.e., the ‘name’ and ‘description’.
| Name | Type | Description |
|---|---|---|
| model (required) | ReleaseModel | Release Model for creating ReleaseModel. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ReleaseModel model = new ReleaseModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Release("<RELEASE_UID>").UpdateAsync(model);ReleaseItemModel
ReleaseItem for create or update release items.
Create
The Create request allows you to add an item (entry or asset) to a Release. To add entries/assets to a Release, you need to provide the UIDs of the entries/assets in ‘items’ in the request body.
| Name | Type | Description |
|---|---|---|
| model (required) | ReleaseItemModel | ReleaseItem Model for creating ReleaseItem. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ReleaseItemModel model = new ReleaseItemModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Release("<RELEASE_UID>").Item().Create(model);CreateAsync
The Create request allows you to add an item (entry or asset) to a Release. To add entries/assets to a Release, you need to provide the UIDs of the entries/assets in ‘items’ in the request body.
| Name | Type | Description |
|---|---|---|
| model (required) | ReleaseItemModel | ReleaseItem Model for creating ReleaseItem. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ReleaseItemModel model = new ReleaseItemModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Release("<RELEASE_UID>").Item().CreateAsync(model);CreateMultiple
The Create request allows you to add multiple items (entries and/or assets) to a Release. To add entries/assets to a Release, you need to provide the UIDs of the entries/assets in ‘items’ in the request body.
| Name | Type | Description |
|---|---|---|
| models (required) | List<ReleaseItemModel> | List of ReleaseItem Model for creating ReleaseItem. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ReleaseItemModel model = new ReleaseItemModel();
List<ReleaseItemModel> models = new List<ReleaseItemModel>()
{
model,
};
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Release("<RELEASE_UID>").Item().CreateMultiple(models);CreateMultipleAsync
The Create request allows you to add multiple items (entries and/or assets) to a Release. To add entries/assets to a Release, you need to provide the UIDs of the entries/assets in ‘items’ in the request body.
| Name | Type | Description |
|---|---|---|
| models (required) | List<ReleaseItemModel> | List of ReleaseItem Model for creating ReleaseItem. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ReleaseItemModel model = new ReleaseItemModel();
List<ReleaseItemModel> models = new List<ReleaseItemModel>()
{
model,
};
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Release("<RELEASE_UID>").Item().CreateMultipleAsync(models);Delete
The Delete request deletes one or more items (entries and/or assets) from a specific Release.
| Name | Type | Description |
|---|---|---|
| models (required) | List<ReleaseItemModel> | List of ReleaseItemModel to be deleted. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ReleaseItemModel model = new ReleaseItemModel();
List<ReleaseItemModel> models = new List<ReleaseItemModel>()
{
model,
};
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Release("<RELEASE_UID>").Item("<RELEASE_ITEM_UID>").Delete(models);DeleteAsync
The Delete request deletes one or more items (entries and/or assets) from a specific Release.
| Name | Type | Description |
|---|---|---|
| models (required) | List<ReleaseItemModel> | List of ReleaseItemModel to be deleted. |
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ReleaseItemModel model = new ReleaseItemModel();
List<ReleaseItemModel> models = new List<ReleaseItemModel>()
{
model,
};
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Release("<RELEASE_UID>").Item("<RELEASE_ITEM_UID>").DeleteAsync(models);GetAll
The Get all request retrieves a list of all items (entries and assets) that are part of a specific Release.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Release("<RELEASE_UID>").Item().GetAll();GetAllAsync
The Get all request retrieves a list of all items (entries and assets) that are part of a specific Release.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Release("<RELEASE_UID>").Item().GetAllAsync();UpdateReleaseItem
The Update Release items to their latest versions request let you update all the release items (entries and assets) to their latest versions before deployment.
| Name | Type | Description |
|---|---|---|
| items (required) | List<String> | Release items to update or "$all" for updating all release items. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
List<string> items = new List<string>(){
"<$all>"
}
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Release("<RELEASE_UID>").Item().UpdateReleaseItem(model);UpdateReleaseItemAsync
The Update Release items to their latest versions request let you update all the release items (entries and assets) to their latest versions before deployment.
| Name | Type | Description |
|---|---|---|
| items (required) | List<String> | Release items to update or "$all" for updating all release items. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
List<string> items = new List<string>(){
"<$all>"
}
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Release("<RELEASE_UID>").Item().UpdateReleaseItemAsync(items);ReleaseItemModel
ReleaseItemModel for create or update release.
| Name | Type | Description |
|---|---|---|
| Uid | string | Entry or asset uid. |
| Action | string | Release item action. |
| ContentTypeUID | string | Entry content type uid |
| Locale | string | Entry locale |
| Version | string | Entry version to be release. |
ReleaseModel
ReleaseModel for create or update release.
| Name | Type | Description |
|---|---|---|
| Name | string | Release name to be set. |
| Description | string | Release description to be set. |
| Archived | bool | Set true to archive release |
| Locked | bool | Set true to lock the release content. |
Role
A Role is a collection of permissions that applies to all the users who are assigned to it. Using Roles, you can assign permissions to a group of users rather than assigning permissions individually.
Create
The Create request creates a new role in a stack.
| Name | Type | Description |
|---|---|---|
| model (required) | RoleModel | Role Model for creating Role. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
RoleModel model = new RoleModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Role("<ROLE_UID>").Create(model);CreateAsync
The Create request creates a new role in a stack.
| Name | Type | Description |
|---|---|---|
| model (required) | RoleModel | Role Model for creating Role. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
RoleModel model = new RoleModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Role("<ROLE_UID>").CreateAsync(model);Delete
The Delete call deletes an existing role from your stack
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Role("<ROLE_UID>").Delete();DeleteAsync
The Delete call deletes an existing role from your stack
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Role("<ROLE_UID>").DeleteAsync();Fetch
The Fetch request returns comprehensive information on a specific role.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Role("<ROLE_UID>").Fetch();FetchAsync
The Fetch request returns comprehensive information on a specific role.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Role("<ROLE_UID>").FetchAsync();Query
The Query on Role request returns comprehensive information about all roles created in a stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").Role().Query();Update
The Update request creates a new role in a stack.
| Name | Type | Description |
|---|---|---|
| model (required) | RoleModel | Role Model for creating Role. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
RoleModel model = new RoleModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Role("<ROLE_UID>").UpdateAsync(model);UpdateAsync
The Update request creates a new role in a stack.
| Name | Type | Description |
|---|---|---|
| model (required) | RoleModel | Role Model for creating Role. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
RoleModel model = new RoleModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Role("<ROLE_UID>").UpdateAsync(model);Rules
Base class for all rules in stack.
| Name | Type | Description |
|---|---|---|
| ACL | String | ACL for the rule |
| Restrict | boolean | Set true to restrict rule. |
AssetRules
Rules for setting on Assets.
| Name | Type | Description |
|---|---|---|
| Assets | List<string> | List of asset for adding into rule. |
| Module | String | Modules for the rules to be applied. |
BranchAliasRules
Rules for setting on branch alias.
| Name | Type | Description |
|---|---|---|
| BranchAlias | List<string> | List of branch alias for adding into rule. |
| Module | string | Modules for the rules to be applied. |
BranchRules
Rules for setting on branch.
| Name | Type | Description |
|---|---|---|
| Branches | List<string> | List of branch for adding into rule. |
| Module | string | Modules for the rules to be applied. |
ContentTypeRules
Rules for setting on content type.
| Name | Type | Description |
|---|---|---|
| ContentTypes | List<string> | List of content types for adding into rule. |
| Module | string | Modules for the rules to be applied. |
EnvironmentRules
Rules for setting on environment.
| Name | Type | Description |
|---|---|---|
| Environments | List<string> | List of environments for adding into rule. |
| Module | string | Modules for the rules to be applied. |
FolderRules
Rules for setting on folders.
| Name | Type | Description |
|---|---|---|
| Folders | List<string> | List of folders for adding into rule. |
| Module | string | Modules for the rules to be applied. |
FieldRules
Rule for the field in content type.
| Name | Type | Description |
|---|---|---|
| Actions | List<Action> | List of action for the field rules. |
| conditions | List<Condition> | List of conditions for the field rules. |
| MatchType | string | Match type for the field. |
TaxonomyRules
Rule for the field in taxonomy.
| Name | Type | Description |
|---|---|---|
| Taxonomies | List<string> | List of Taxonomies for adding into rule |
| Terms | List<strings> | List of Terms for adding into rule. |
| ContentTypes | List<TaxonomyContentType> | List of TaxonomyContentType for adding into this rule |
RoleModel
RoleModel for create or update roles.
| Name | Type | Description |
|---|---|---|
| Name | string | Role name to be set. |
| Description | string | Role description to be set. |
| Rules | List<Rule> | List of rules added to the role. |
| DeployContent | bool | Set true to deploy the rule content. |
Server
Server for the webhook
| Name | Type | Description |
|---|---|---|
| Name | string | Server name. |
Stack
A stack is a repository or a container that holds all the content/assets of your site. It allows multiple users to create, edit, approve, and publish their content within a single space.
| Name | Type | Description |
|---|---|---|
| APIKey | string | Stack API key. |
| Branch | string | Stack branch if present. |
| ManagementToken | string | Stack management token. |
AddSettings
The Add stack settings request lets you add additional settings for your existing stack.
| Name | Type | Description |
|---|---|---|
| settings (required) | StackSettings | Stack settings details. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>")
.AddSettings(settings);AddSettingsAsync
The Add stack settings request lets you add additional settings for your existing stack.
| Name | Type | Description |
|---|---|---|
| settings (required) | StackSettings | Stack settings details. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>")
.AddSettingsAsync(settings);Asset
Asset refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded in your Contentstack repository for future use.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, asset uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Asset asset = client.stack("<API_KEY>").Asset("<UID>");AuditLog
A AuditLog displays a record of all the activities performed in a stack and helps you keep a track of all published items, updates, deletes, and current status of the existing content.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, content type uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
AuditLog auditLog = client.stack("<API_KEY>").AuditLog("<UID>");ContentType
ContentType defines the structure or schema of a page or a section of your web or mobile property. To create content for your application, you are required to first create a content type, and then create entries using the content type.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, content type uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentType contentType = client.stack("<API_KEY>").ContentType("<UID>");Create
The Create stack call creates a new stack in your Contentstack account.
| Name | Type | Description |
|---|---|---|
| name (required) | string | The name for Stack. |
| masterLocale (required) | string | The Master Locale for Stack |
| organisationUid (required) | string | The Organization Uid in which you want to create Stack. |
| description | string | The description for the Stack. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.stack("<API_KEY>")
.Create("<STACK_NAME>", "<LOCALE>", "<ORG_UID>", "<DESCRIPTION>");CreateAsync
The Create stack call creates a new stack in your Contentstack account.
| Name | Type | Description |
|---|---|---|
| name (required) | string | The name for Stack. |
| masterLocale (required) | string | The Master Locale for Stack |
| organisationUid (required) | string | The Organization Uid in which you want to create Stack. |
| description | string | The description for the Stack. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.stack("<API_KEY>")
.CreateAsync("<STACK_NAME>", "<LOCALE>", "<ORG_UID>", "<DESCRIPTION>");DeliveryToken
You can use DeliveryToken to authenticate Content Delivery API (CDA) requests and retrieve the published content of an environment.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, delivery token uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
DeliveryToken deliveryToken = client.stack("<API_KEY>").DeliveryToken("<UID>");Environment
A publishing Environment corresponds to one or more deployment servers or a content delivery destination where the entries need to be published.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, extension uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Environment environment = client.stack("<API_KEY>").Environment("<UID>");Extension
Extension let you create custom fields and custom widgets that lets you customize Contentstack's default UI and behavior.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, extension uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Extension extension = client.stack("<API_KEY>").Extension("<UID>");Fetch
The Get a single stack call fetches comprehensive details of a specific stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Fetch();FetchAsync
The Get a single stack call fetches comprehensive details of a specific stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").FetchAsync();GetAll
The Get all stacks call fetches the list of all stacks owned by and shared with a particular user account.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack().GetAll();GetAllAsync
The Get all stacks call fetches the list of all stacks owned by and shared with a particular user account.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack().GetAllAsync();GlobalField
A GlobalField is a reusable field (or group of fields) that you can define once and reuse in any content type within your stack. This eliminates the need (and thereby time and efforts) to create the same set of fields repeatedly in multiple content types.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, global field uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
GlobalField globalField = client.stack("<API_KEY>").GlobalField("<UID>");Label
Label allow you to group a collection of content within a stack. Using labels you can group content types that need to work together.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, label uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Label label = client.stack("<API_KEY>").Label("<UID>");Locale
Contentstack has a sophisticated multilingual capability. It allows you to create and publish entries in any language.
| Name | Type | Description |
|---|---|---|
| code | string | Optional, locale code. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Locale locale = client.stack("<API_KEY>").Locale("<CODE>");ManagementTokens
You can use ManagementToken to authenticate Content Management API (CMA) requests over your stack content.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, management uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ManagementToken managementTokens = client.stack("<API_KEY>").ManagementTokens("<UID>");PublishQueue
A PublishQueue displays the historical and current details of activities such as publish, unpublish, or delete that can be performed on entries and/or assets. It also shows details of Release deployments. These details include time, entry, content type, version, language, user, environment, and status.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, publish queue uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
PublishQueue PublishQueue = client.stack("<API_KEY>").PublishQueue("<UID>");Release
A Release is a set of entries and assets that needs to be deployed (published or unpublished) all at once to a particular environment.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, release uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Release release = client.stack("<API_KEY>").Release("<UID>");ResetSettings
The Reset stack settings call resets your stack to default settings, and additionally, lets you add parameters to or modify the settings of an existing stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.stack("<API_KEY>")
.ResetSettings();ResetSettingsAsync
The Reset stack settings call resets your stack to default settings, and additionally, lets you add parameters to or modify the settings of an existing stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.stack("<API_KEY>")
.ResetSettingsAsync();Role
A Role collection of permissions that will be applicable to all the users who are assigned this role.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, role uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Role role = client.stack("<API_KEY>").Role("<WORKFLOW_UID>");Settings
The Get stack settings call retrieves the configuration settings of an existing stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.stack("<API_KEY>")
.Settings();SettingsAsync
The Get stack settings call retrieves the configuration settings of an existing stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.stack("<API_KEY>")
.SettingsAsync();Share
The Share a stack call shares a stack with the specified user to collaborate on the stack.
| Name | Type | Description |
|---|---|---|
| email (required) | string | User email to be shared stack access. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
UserInvitation invitation = new UserInvitation()
{
Email = "<EMAIL>",
Roles = new System.Collections.Generic.List<string>() { "<ROLE_UID>" }
};
ContentstackResponse contentstackResponse = client.stack("<API_KEY>")
.Share(
new List() {
invitation
}
);ShareAsync
The Share a stack call shares a stack with the specified user to collaborate on the stack.
| Name | Type | Description |
|---|---|---|
| invitations (required) | List<UserInvitation> | List of user email with roles to be assign from Stack. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
UserInvitation invitation = new UserInvitation()
{
Email = "<EMAIL>",
Roles = new System.Collections.Generic.List<string>() { "<ROLE_UID>" }
};
ContentstackResponse contentstackResponse = await client.stack("<API_KEY>")
.ShareAsync(
new List() {
invitation
}
);TransferOwnership
The Transfer stack ownership to other users call sends the specified user an email invitation for accepting the ownership of a particular stack.
| Name | Type | Description |
|---|---|---|
| email (required) | string | User email to transfer the stack ownership. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.stack("<API_KEY>")
.TransferOwnership("<EMAIL>");TransferOwnershipAsync
The Transfer stack ownership to other users call sends the specified user an email invitation for accepting the ownership of a particular stack.
| Name | Type | Description |
|---|---|---|
| email (required) | string | User email to transfer the stack ownership. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.stack("<API_KEY>")
.TransferOwnershipAsync("<EMAIL>");UnShare
The Unshare a stack call unshares a stack with a user and removes the user account from the list of collaborators.
| Name | Type | Description |
|---|---|---|
| email (required) | string | User email to be removed from stack. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.stack("<API_KEY>")
.UnShare("<EMAIL>");UnShareAsync
The Unshare a stack call unshares a stack with a user and removes the user account from the list of collaborators.
| Name | Type | Description |
|---|---|---|
| email (required) | string | User email to be removed from stack. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.stack("<API_KEY>")
.UnShareAsync("<EMAIL>");Update
The Update stack call lets you update the name and description of an existing stack.
| Name | Type | Description |
|---|---|---|
| name (required) | string | The name for Stack. |
| description | string | The description for the Stack. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.stack("<API_KEY>")
.Update("<STACK_NAME>", "<DESCRIPTION>");UpdateAsync
The Update stack call lets you update the name and description of an existing stack.
| Name | Type | Description |
|---|---|---|
| name (required) | string | The name for Stack. |
| description | string | The description for the Stack. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.stack("<API_KEY>")
.UpdateAsync("<STACK_NAME>", "<DESCRIPTION>");UpdateUserRole
The Update User Role API Request updates the roles of an existing user account.
| Name | Type | Description |
|---|---|---|
| usersRole (required) | List<UserInvitation> | List of user and roles to be assigned in Stack. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
UserInvitation invitation = new UserInvitation()
{
Uid = "<USER_ID>",
Roles = new System.Collections.Generic.List<string>() { "<ROLE_UID>" }
};
ContentstackResponse contentstackResponse = client.stack("<API_KEY>")
.UpdateUserRole(
new List<UserInvitation>() {
invitation
}
);UpdateUserRoleAsync
The Update User Role API Request updates the roles of an existing user account.
| Name | Type | Description |
|---|---|---|
| usersRole (required) | List<UserInvitation> | List of user and roles to be assigned in Stack. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
UserInvitation invitation = new UserInvitation()
{
Uid = "<USER_ID>",
Roles = new System.Collections.Generic.List<string>() { "<ROLE_UID>" }
};
ContentstackResponse contentstackResponse = await client.stack("<API_KEY>")
.UpdateUserRoleAsync(
new List<UserInvitation>() {
invitation
}
);Webhook
A Webhook a mechanism that sends real-time information to any third-party app or service to keep your application in sync with your Contentstack account.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, webhook uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Webhook webhook = client.stack("<API_KEY>").Webhook("<UID>");Workflow
A Workflow is a tool that allows you to streamline the process of content creation and publishing, and lets you manage the content lifecycle of your project smoothly.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional, workflow uid. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Workflow workflow = client.stack("<API_KEY>").Workflow("<WORKFLOW_UID>");StackSettings
Stack settings for adding custom settings.
| Name | Type | Description |
|---|---|---|
| DiscreteVariables | Dictionary<string, object> | DiscreteVariables to add in stack settings |
| Rte | Dictionary<string, object> | |
| StackVariables | Dictionary<string, object> | Stack variables for adding into stack |
User
User session consists of calls that will help you to sign in and sign out of your Contentstack account.
ForgotPassword
The Forgot password call sends a request for a temporary password to log in to an account in case a user has forgotten the login password.
| Name | Type | Description |
|---|---|---|
| email (required) | string | The email for the account that user has forgotten the login password |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.ForgotPassword("<EMAIL>");ForgotPasswordAsync
The Forgot password call sends a request for a temporary password to log in to an account in case a user has forgotten the login password.
| Name | Type | Description |
|---|---|---|
| email (required) | string | The email for the account that user has forgotten the login password |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.ForgotPasswordAsync("<EMAIL>");ResetPassword
The Reset password call sends a request for resetting the password of your Contentstack account.
| Name | Type | Description |
|---|---|---|
| resetToken (required) | string | The reset password token send to email. |
| password (required) | string | The password for the account. |
| confirmPassword (required) | string | The confirm password for the account. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.ResetPassword("<RESET_TOKEN>", "<PASSWORD>", "<CONFIRM_PASSWORD>");ResetPasswordAsync
The Reset password call sends a request for resetting the password of your Contentstack account.
| Name | Type | Description |
|---|---|---|
| resetToken (required) | string | The reset password token send to email. |
| password (required) | string | The password for the account. |
| confirmPassword (required) | string | The confirm password for the account. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.ResetPasswordAsync("<RESET_TOKEN>", "<PASSWORD>", "<CONFIRM_PASSWORD>");UserInvitation
User invitation model to invite user to stacks or organisations.
| Name | Type | Description |
|---|---|---|
| string | User email for invitation to be sent. | |
| Roles | List<string> | Roles from stack/organization to be assigned to user. |
Version
Version naming allows you to assign a name to a version of an entry/asset for easy identification.
Delete
The Delete Version Name of Entry/Asset request allows you to delete the name assigned to a specific version of an entry/asset. This request resets the name of the entry/asset version to the version number.
| Name | Type | Description |
|---|---|---|
| locale | string | Locale for the entry version to be deleted |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Version("<VERSION>").Delete();using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Asset("<ASSET_UID>").Version("<VERSION>").Delete();DeleteAsync
The Delete Version Name of Entry/Asset request allows you to delete the name assigned to a specific version of an entry/asset. This request resets the name of the entry/asset version to the version number.
| Name | Type | Description |
|---|---|---|
| locale | string | Locale for the entry version to be deleted |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Version("<VERSION>").DeleteAsync();using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Asset("<ASSET_UID>").Version("<VERSION>").DeleteAsync();GetAll
The Get Details of All Versions of an Entry request allows you to retrieve the details of all the versions of an entry.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Version("<VERSION>").GetAll();using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Asset("<ASSET_UID>").Version("<VERSION>").GetAll();GetAllAsync
The Get Details of All Versions of an Entry request allows you to retrieve the details of all the versions of an entry.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Version("<VERSION>").GetAllAsync();using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Asset("<ASSET_UID>").Version("<VERSION>").GetAllAsync();SetName
The Set Version Name for Entry/Asset request allows you to assign a name to a specific version of an entry/asset.
| Name | Type | Description |
|---|---|---|
| name | string | Version name to be assigned to entry/asset. |
| locale | string | Locale for the version. |
| force | bool | Set true to force update the version name of the master entry. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Version("<VERSION>").SetName("<VERSION_NAME>");using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Asset("<ASSET_UID>").Version("<VERSION>").SetName("<VERSION_NAME>");SetNameAsync
The Set Version Name for Entry/Asset request allows you to assign a name to a specific version of an entry/asset.
| Name | Type | Description |
|---|---|---|
| name | string | Version name to be assigned to entry/asset. |
| locale | string | Locale for the version. |
| force | bool | Set true to force update the version name of the master entry. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").Version("<VERSION>").SetNameAsync("<VERSION_NAME>");using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Asset("<ASSET_UID>").Version("<VERSION>").SetNameAsync("<VERSION_NAME>");Workflow
A webhook is a user-defined HTTP callback. It is a mechanism that sends real-time information to any third-party app or service.
Create
The Create a webhook request allows you to create a new webhook in a specific stack.
| Name | Type | Description |
|---|---|---|
| model (required) | WebhookModel | Webhook Model for creating Webhook. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
WebhookModel model = new WebhookModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").Create(model);CreateAsync
The Create a webhook request allows you to create a new webhook in a specific stack.
| Name | Type | Description |
|---|---|---|
| model (required) | WebhookModel | Webhook Model for creating Webhook. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
WebhookModel model = new WebhookModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").CreateAsync(model);Delete
The Delete webhook call deletes an existing webhook from a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").Delete();DeleteAsync
The Delete webhook call deletes an existing webhook from a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").DeleteAsync();Executions
The Get executions of a webhook request allows you to fetch the execution details of a specific webhook, which includes the execution UID.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").Executions();ExecutionsAsync
The Get executions of a webhook request allows you to fetch the execution details of a specific webhook, which includes the execution UID.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").ExecutionsAsync();Fetch
The Fetch webhook request returns comprehensive information on a specific webhook.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").Fetch();FetchAsync
The Fetch webhook request returns comprehensive information on a specific webhook.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").FetchAsync();Logs
This call will return a comprehensive detail of all the webhooks that were executed at a particular execution cycle.
| Name | Type | Description |
|---|---|---|
| executionUid | string | Execution UID that you receive when you execute the 'Get executions of webhooks' call. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").Logs("<EXECUTION_UID>");LogsAsync
This call will return a comprehensive detail of all the webhooks that were executed at a particular execution cycle.
| Name | Type | Description |
|---|---|---|
| executionUid | string | Execution UID that you receive when you execute the 'Get executions of webhooks' call. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").LogsAsync("<EXECUTION_UID>");Query
The Query Webhooks request returns comprehensive information on all the available webhooks in the specified stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").Webhook().Query();Retry
This call makes a manual attempt to execute a webhook after the webhook has finished executing its automatic attempts.
| Name | Type | Description |
|---|---|---|
| executionUid | string | Execution UID that you receive when you execute the 'Get executions of webhooks' call. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").Retry("<EXECUTION_UID>");RetryAsync
This call makes a manual attempt to execute a webhook after the webhook has finished executing its automatic attempts.
| Name | Type | Description |
|---|---|---|
| executionUid | string | Execution UID that you receive when you execute the 'Get executions of webhooks' call. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").RetryAsync("<EXECUTION_UID>");Update
The Update webhook request allows you to update the details of an existing webhook in the stack.
| Name | Type | Description |
|---|---|---|
| model (required) | WebhookModel | Webhook Model for creating Webhook. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
WebhookModel model = new WebhookModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").Update(model);UpdateAsync
The Update webhook request allows you to update the details of an existing webhook in the stack.
| Name | Type | Description |
|---|---|---|
| model (required) | WebhookModel | Webhook Model for creating Webhook. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
WebhookModel model = new WebhookModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Webhook("<WEBHOOK_UID>").UpdateAsync(model);WebhookModel
WebhookModel for creating or updating webhook.
| Name | Type | Description |
|---|---|---|
| Name | string | Name for the webhook. |
| Branches | List<string> | List of branches to be added for the webhook. |
| Channels | List<string> | List of channels on which webhook to be triggerd. |
| ConcisePayload | bool | Set true if required concise payload. |
| destinations | List<WebhookTarget> | List of webhook target to be triggerd. |
| Disabled | bool | Set true for disabling the webhook. |
| RetryPolicy | string | Set retry policy to perform retry on when webhook is failed. |
WebhookTarget
WebhookTarget for creating or updating webhook.
| Name | Type | Description |
|---|---|---|
| CustomHeader | List<Dictionary<string, object>> | List of custom header to be added in webhook. |
| HttpBasicAuth | string | Basic auth for the http request. |
| HttpBasicPassword | string | Http Password if required to authorize target. |
| TargetUrl | string | Target url for the request to be triggered. |
Workflow
A workflow is an order of steps to define the roadmap for a process. This enables users to maintain a systematic approach for reviewing and approving content.
Create
The Create Workflow request allows you to create a Workflow.
| Name | Type | Description |
|---|---|---|
| model (required) | WorkflowModel | Workflow Model for updating Content Type. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
WorkflowModel model = new WorkflowModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().Create(model);CreateAsync
The Create Workflow request allows you to create a Workflow.
| Name | Type | Description |
|---|---|---|
| model (required) | WorkflowModel | Workflow Model for updating Content Type. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
WorkflowModel model = new WorkflowModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().CreateAsync(model);Delete
The Delete Workflow request allows you to delete a workflow.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow("<WORKFLOW_UID>").Delete();DeleteAsync
The Delete Workflow request allows you to delete a workflow.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow("<WORKFLOW_UID>").DeleteAsync();Disable
The Disable Workflow request allows you to disable a workflow.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow("<WORKFLOW_UID>").Disable();DisableAsync
The Disable Workflow request allows you to disable a workflow.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow("<WORKFLOW_UID>").DisableAsync();Enable
The Enable Workflow request allows you to enable a workflow.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow("<WORKFLOW_UID>").Enable();EnableAsync
The Enable Workflow request allows you to enable a workflow.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow("<WORKFLOW_UID>").EnableAsync();Fetch
The fetch Workflow request retrieves the comprehensive details of a specific Workflow of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow("<WORKFLOW_UID>").Fetch();FetchAsync
The fetch Workflow request retrieves the comprehensive details of a specific Workflow of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow("<WORKFLOW_UID>").FetchAsync();FindAll
The Get all Workflows request retrieves the details of all the Workflows of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().FindAll();FindAllAsync
The Get all Workflows request retrieves the details of all the Workflows of a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().FindAllAsync();GetPublishRule
The Get Publish Rules by Content Types request allows you to retrieve details of a Publish Rule applied to a specific content type of your stack.
| Name | Type | Description |
|---|---|---|
| contentType (required) | string | ContentType for getting publish rules. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().GetPublishRule("CONTENT_TYPE_UID")GetPublishRuleAsync
The Get Publish Rules by Content Types request allows you to retrieve details of a Publish Rule applied to a specific content type of your stack.
| Name | Type | Description |
|---|---|---|
| contentType (required) | string | ContentType for getting publish rules. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow().GetPublishRuleAsync("CONTENT_TYPE_UID")PublishRule
PublishRule is a tool that allows you to streamline the process of content creation and publishing, and lets you manage the content lifecycle of your project smoothly.
| Name | Type | Description |
|---|---|---|
| uid | string | Optional Publish rule uid for performing rule specific operation |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow().PublishRule("<ENTRY_UID>")Update
The Update Workflow request allows you to add a workflow stage or update the details of the existing stages of a workflow.
| Name | Type | Description |
|---|---|---|
| model (required) | WorkflowModel | Workflow Model for updating Content Type. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
WorkflowModel model = new WorkflowModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").Workflow("<WORKFLOW_UID>").Update(model);UpdateAsync
The Update Workflow request allows you to add a workflow stage or update the details of the existing stages of a workflow.
| Name | Type | Description |
|---|---|---|
| model (required) | WorkflowModel | Workflow Model for updating Content Type. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
WorkflowModel model = new WorkflowModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").Workflow("<WORKFLOW_UID>").UpdateAsync(model);WorkflowModel
WorkflowModel for creating or updating workflow.
| Name | Type | Description |
|---|---|---|
| Name | string | Name for the workflow. |
| AdminUsers | Dictionary<string, object> | Admin user for the workflow. |
| Branches | List<string> | List of branches for the workflow accessible. |
| ContentTypes | List<string> | List of content types for the workflow. |
| Enabled | bool | Set true to enable workflow. |
| WorkflowStages | List<WorkflowStage> | List of workflow stage for the workflow. |
WorkflowStage
WorkflowStage model for creating or updating workflow stages.
| Name | Type | Description |
|---|---|---|
| Uid | string | Uid for workflow stage. |
| Name | string | Name for the workflow stage. |
| Color | string | Color for the workflow stage. |
| NextAvailableStages | List<string> | List of next workflow stages. |
| AllStages | bool | Set true if required all stages |
| AllUsers | bool | Set true for all users. |
| EntryLock | string | |
| SpecificStages | bool | |
| SpecificUsers | bool | |
| SystemACL | Dictionary<string, object> |
CustomFieldModel
CustomFieldModel class for custom field.
| Name | Type | Description |
|---|---|---|
| Title | string | Title for the custom field. |
| ContentType | string | File content type. |
| Tags | string | Tags for the custom field. |
CustomFieldModel
CustomFieldModel constructor
| Name | Type | Description |
|---|---|---|
| filePath (required) | String | File path to upload custom field. |
| contentType (required) | string | Content type for the file to be uploaded. |
| title (required) | string | Title for the custom field. |
| tags | string | Tags for the custom field. |
| Name | Type | Description |
|---|---|---|
| stream (required) | Stream | File stream for the custom field to be upload. |
| contentType (required) | string | Content type for the file stream. |
| title (required) | string | Title for the custom field. |
| tag | string | Tags for the custom field. |
| Name | Type | Description |
|---|---|---|
| bytes (required) | byte[] | Bytes for the file to be uploaded. |
| contentType (required) | string | Content type for the file bytes. |
| title (required) | string | Title for the custom field. |
| tags | string | Tags for the custom field. |
| Name | Type | Description |
|---|---|---|
| byteArray (required) | ByteArrayContent | Byte array content of file to be uploaded. |
| contentType (required) | string | Content type for the file byte content |
| title (required) | string | Title for the custom field. |
| tags | string | Tags for the custom field |
GetHttpContent
Get http content returns the request body content.
CustomWidgetModel
CustomWidgetModel class for custom widget.
| Name | Type | Description |
|---|---|---|
| Title | string | Title for the custom widget. |
| ContentType | string | File content type. |
| Tags | string | Tags for the custom widget. |
CustomWidgetModel
CustomWidgetModel constructor
| Name | Type | Description |
|---|---|---|
| filePath (required) | String | File path to upload custom widget. |
| contentType (required) | string | Content type for the file to be uploaded. |
| title (required) | string | Title for the custom widget. |
| tags | string | Tags for the widget |
| Name | Type | Description |
|---|---|---|
| stream (required) | Stream | File stream for the custom widget to be upload. |
| contentType (required) | string | Content type for the file stream. |
| title (required) | string | Title for the custom widget. |
| tag | string | Tags for the custom widget. |
| Name | Type | Description |
|---|---|---|
| bytes (required) | byte[] | Bytes for the file to be uploaded. |
| contentType (required) | string | Content type for the file bytes. |
| title (required) | string | Title for the custom widget. |
| tags | string | Tags for the custom widget. |
| Name | Type | Description |
|---|---|---|
| byteArray (required) | ByteArrayContent | Byte array content of file to be uploaded. |
| contentType (required) | string | Content type for the file byte content |
| title (required) | string | Title for the custom widget. |
| tags | string | Tags for the custom widget |
GetHttpContent
Get http content returns the request body content.
DashboardWidgetModel
DashboardWidgetModel class for dashboard widget.
| Name | Type | Description |
|---|---|---|
| Title | string | Title for the dashboard widget. |
| ContentType | string | File content type. |
| Tags | string | Tags for the dashboard widget. |
DashboardWidgetModel
DashboardWidgetModel constructor
| Name | Type | Description |
|---|---|---|
| filePath (required) | String | File path to upload dashboard widget. |
| contentType (required) | string | Content type for the file to be uploaded. |
| title (required) | string | Title for the dashboard widget. |
| tags | string | Tags for the widget |
| Name | Type | Description |
|---|---|---|
| stream (required) | Stream | File stream for the dashboard widget to be upload. |
| contentType (required) | string | Content type for the file stream. |
| title (required) | string | Title for the dashboard widget. |
| tag | string | Tags for the dashboard widget. |
| Name | Type | Description |
|---|---|---|
| bytes (required) | byte[] | Bytes for the file to be uploaded. |
| contentType (required) | string | Content type for the file bytes. |
| title (required) | string | Title for the dashboard widget. |
| tags | string | Tags for the dashboard widget. |
| Name | Type | Description |
|---|---|---|
| byteArray (required) | ByteArrayContent | Byte array content of file to be uploaded. |
| contentType (required) | string | Content type for the file byte content |
| title (required) | string | Title for the dashboard widget. |
| tags | string | Tags for the dashboard widget |
GetHttpContent
Get http content returns the request body content.
DateField
DateField class for date field.
| Name | Type | Description |
|---|---|---|
| StartDate | string | Start date for the date field. |
| EndDate | string | End date for date field |
ExtensionField
Extension class for extension field.
| Name | Type | Description |
|---|---|---|
| config | Dictionary<string, object> | Configuration for the extension field. |
| extension_uid | string | Extension field unique id. |
Field
Action class for setting action for the field.
| Name | Type | Description |
|---|---|---|
| DataType | string | Determines what value can be provided to the Title field. |
| DisplayName | string | Determines the display name of a field. It is a mandatory field. |
| FieldMetadata | FieldMetadata | Allows you to enter additional data about a field. Also, you can add additional values under ‘field_metadata’. |
| Mandatory | bool | Set true if field is mandatory. |
| Multiple | bool | Set true if field value to be multiple. |
| Uid | string | Represents the unique ID of each field. It is a mandatory field. |
| Unique | bool | Set true if field value to be unique |
FieldMetadata
Metadata details for the field.
| Name | Type | Description |
|---|---|---|
| AllowRichText | bool | Determines whether the editor will support rich text, and is set to ‘true’ by default for Rich Text Editors. |
| Default | string | Allows you to set default fields for content types. |
| DefaultValue | object | Allows you to set a default value for a field. |
| Description | string | Allows you to provide the content for the Rich text editor field. |
| Instruction | string | Allows you to add instructions for the content managers while entering values for a field. The instructional text appears below the field. |
| Markdown | bool | Lets you assign a field to be a markdown by setting its value to ‘true’. |
| Multiline | bool | Provides multi-line capabilities to the Rich text editor. |
| Options | List<string> | If you choose the Custom editor, then the options key lets you specify the formatting options you prefer for your RTE toolbar, e.g., "options": ["h3", "blockquote", "sup"] |
| Placeholder | string | Allows you to provide a hint text about the values that need to be entered in an input field, e.g., Single Line Textbox. This text can be seen inside the field until you enter a value. |
| RefMultiple | bool | Allows you to set single or multiple reference to Reference field. |
| RichTextType | string | Lets you enable either the basic, custom, or advanced editor to enter your content. |
| Version | int | This key determines whether you are using the older version of the Rich Text Editor or the latest version. The value of 1 denotes that it is an older version of the editor, while 3 denotes that it is the latest version of the editor. |
Action
Action class for setting action for the field.
| Name | Type | Description |
|---|---|---|
| state | string | Action state for the field. |
| TargetField | string | Target field for the action. |
FileField
File field class for adding file field in content type.
| Name | Type | Description |
|---|---|---|
| Extensions | List<string> | List of extension allowed in file field. |
GroupField
Group field class for adding group field in content type.
| Name | Type | Description |
|---|---|---|
| Format | string | Format for the group field. |
| MaxInstance | int | Max instance for the group filed to be allowed. |
| Schema | List<Field> | Schema details for the group field. |
Block
Block class for adding blocks in modular block field.
| Name | Type | Description |
|---|---|---|
| Uid | string | UID for the block field. |
| Title | string | Title for the block field |
| AutoEdit | bool | Enable auto edit for the block. |
| BlockType | bool | Set true if block type. |
| Schema | List<Field> | Schema details for the block field. |
ModularBlockField
ModularBlock field class for adding modular block field to content type.
| Name | Type | Description |
|---|---|---|
| blocks | List<Block> | List of blocks in modular block field. |
ReferenceField
Reference field class for adding reference field to content type.
| Name | Type | Description |
|---|---|---|
| Plugins | List<string> | List of plugins to be added in reference field. |
| ReferenceTo | object | Set of content type to be added as reference in this field. |
SelectEnum
Select field enum types.
| Name | Type | Description |
|---|---|---|
| Advanced | bool | Set true to select input type of advance. |
| Choices | List<Dictionary<string, object>> | List of choice to be added in selection of select field. |
TextboxField
Select field class for select input field
| Name | Type | Description |
|---|---|---|
| Enum | SelectEnum | Select enum for field type. |
TextboxField
Text box field class for text input field
| Name | Type | Description |
|---|---|---|
| ErrorMessages | Dictionary<string, string> | Error messages for the field |
| Format | string | Text field format. |
DeliveryToken
Delivery Tokens are tokens that provide you with read-only access to the associated environments. It is a credential—used along with the stack API key—to make authorized Content Delivery API requests for retrieving the published content of an environment.
Create
The Create request is used to create a delivery token in the stack.
| Name | Type | Description |
|---|---|---|
| model (required) | DeliveryTokenModel | Delivery Token Model for creating delivery token. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
DeliveryTokenModel model = new DeliveryTokenModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").DeliveryToken().Create(model);CreateAsync
The Create request is used to create a delivery token in the stack.
| Name | Type | Description |
|---|---|---|
| model (required) | DeliveryTokenModel | Delivery Token Model for creating delivery token. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
DeliveryTokenModel model = new DeliveryTokenModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").DeliveryToken().CreateAsync(model);Delete
The Delete request deletes a specific delivery token.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").DeliveryToken("<DELIVERY_TOKEN_UID>").Delete();DeleteAsync
The Delete request deletes a specific delivery token.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").DeliveryToken("<DELIVERY_TOKEN_UID>").DeleteAsync();Fetch
The Fetch function returns the details of all the delivery tokens created in a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").DeliveryToken("<DELIVERY_TOKEN_UID>").Fetch();FetchAsync
The Fetch function returns the details of all the delivery tokens created in a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").DeliveryToken("<DELIVERY_TOKEN_UID>").FetchAsync();Query
The Query on DeliveryToken returns the details of all the delivery tokens created in a stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
query = client.Stack("<API_KEY>").DeliveryToken().Query();Update
The Update request lets you update the details of a delivery token.
| Name | Type | Description |
|---|---|---|
| model (required) | DeliveryTokenModel | Delivery Token Model for creating delivery token. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
DeliveryTokenModel model = new DeliveryTokenModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").DeliveryToken("<DELIVERY_TOKEN_UID>").Update(model);UpdateAsync
The Update request lets you update the details of a delivery token.
| Name | Type | Description |
|---|---|---|
| model (required) | DeliveryTokenModel | Delivery Token Model for creating delivery token. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
DeliveryTokenModel model = new DeliveryTokenModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").DeliveryToken("<DELIVERY_TOKEN_UID>").UpdateAsync(model);ManagementToken
Management Tokens are tokens that provide you with read-write access to the content of your stack. It is a credential—used along with the stack API key—to make authorized Content Management API (CMA) requests for managing content of your stack.
Create
The Create request is used to create a management token in a stack. This token provides you with read-write access to the content of your stack.
| Name | Type | Description |
|---|---|---|
| model (required) | ManagementTokenModel | ManagementToken Model for creating ManagementToken. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ManagementTokenModel model = new ManagementTokenModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ManagementToken("<MANAGEMENT_TOKEN_UID>").Create(model);CreateAsync
The Create request is used to create a management token in a stack. This token provides you with read-write access to the content of your stack.
| Name | Type | Description |
|---|---|---|
| model (required) | ManagementTokenModel | ManagementToken Model for creating ManagementToken. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ManagementTokenModel model = new ManagementTokenModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ManagementToken("<MANAGEMENT_TOKEN_UID>").CreateAsync(model);Delete
The Delete request deletes a specific management token.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ManagementToken("<MANAGEMENT_TOKEN_UID>").Delete();DeleteAsync
The Delete request deletes a specific management token.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ManagementToken("<MANAGEMENT_TOKEN_UID>").DeleteAsync();Fetch
The Fetch request returns the details of a specific management token generated in a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ManagementToken("<MANAGEMENT_TOKEN_UID>").Fetch();FetchAsync
The Fetch request returns the details of a specific management token generated in a stack.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ManagementToken("<MANAGEMENT_TOKEN_UID>").FetchAsync();Query
The Query on ManagementToken request returns the details of all the management tokens generated in a stack.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack("<API_KEY>").ManagementToken().Query();Update
The Update request lets you update the details of a management token. You can change the name and description of the token, update the stack-level permissions assigned to the token, and change the expiry date of the token (if set).
| Name | Type | Description |
|---|---|---|
| model (required) | ManagementTokenModel | ManagementToken Model for creating ManagementToken. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ManagementTokenModel model = new ManagementTokenModel();
ContentstackResponse contentstackResponse = client.Stack("<API_KEY>").ManagementToken("<MANAGEMENT_TOKEN_UID>").Update(model);UpdateAsync
The Update request lets you update the details of a management token. You can change the name and description of the token, update the stack-level permissions assigned to the token, and change the expiry date of the token (if set).
| Name | Type | Description |
|---|---|---|
| model (required) | ManagementTokenModel | ManagementToken Model for creating ManagementToken. |
| collection | ParameterCollection | Query parameter collection. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Models.Tokens;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ManagementTokenModel model = new ManagementTokenModel();
ContentstackResponse contentstackResponse = await client.Stack("<API_KEY>").ManagementToken("<MANAGEMENT_TOKEN_UID>").UpdateAsync(model);DeliveryTokenModel
Delivery token scope for the token to be accessible.
| Name | Type | Description |
|---|---|---|
| Name | string | Name for the delivery token to be created or updated. |
| Description | string | Description for the delivery token to be created or updated. |
| Scope | List<DeliveryTokenScope> | List of token scope for stack-level permissions you need to assign to the token. |
DeliveryTokenScope
Delivery token scope for setting the environment for the token to be accessible.
| Name | Type | Description |
|---|---|---|
| Environments | List<string> | List of environment for the token to be accessible. |
ManagementTokenModel
| Name | Type | Description |
|---|---|---|
| Name | string | Name for the management token. |
| Description | string | Description for the management token. |
| ExpiresOn | string | Expiration date of the token in UTC time |
| IsEmailNotificationEnabled | bool | Enable notification for the token expiration before seven days. |
| Scope | List<TokenScope> | List of token scope for stack-level permissions you need to assign to the token. |
TokenScope
| Name | Type | Description |
|---|---|---|
| ACL | Dictionary<string, string> | ACL permissions determine what actions the user or group can perform on a token, such as reading, writing, or executing a file. |
| Branches | List<string> | Branches on which token scope should be defined. |
| Module | string | Module scope for the token. |
BoolParameterValue
Bool parameter value.
| Name | Type | Description |
|---|---|---|
| Value | bool | Boolean value of the parameter. |
BoolParameterValue
Constructs ParameterValue for a boolean.
| Name | Type | Description |
|---|---|---|
| value | bool | Value for the query parameter. |
DoubleListParameterValue
Double list parameter value.
| Name | Type | Description |
|---|---|---|
| Value | List<double> | Double value of the parameter. |
DoubleListParameterValue
Constructs ParameterValue for a list of double.
| Name | Type | Description |
|---|---|---|
| value | List<Double> | Value for the query parameter. |
DoubleParameterValue
Double parameter value.
| Name | Type | Description |
|---|---|---|
| Value | double | Double value of the parameter. |
DoubleParameterValue
Constructs ParameterValue for a double.
| Name | Type | Description |
|---|---|---|
| value | double | Value for the query parameter. |
ParameterCollection
Add
Adds a parameter with a boolean value.
| Name | Type | Description |
|---|---|---|
| key (required) | string | Parameter key to be added. |
| value (required) | bool | Parameter value to be added |
Add
Adds a parameter with a list-of-doubles value.
| Name | Type | Description |
|---|---|---|
| key (required) | string | Parameter key to be added. |
| value (required) | List<double> | Parameter value to be added |
Add
Adds a parameter with a list-of-strings value.
| Name | Type | Description |
|---|---|---|
| key (required) | string | Parameter key to be added. |
| value (required) | List<String> | Parameter value to be added |
Add
Adds a parameter with a double value.
| Name | Type | Description |
|---|---|---|
| key (required) | string | Parameter key to be added. |
| value (required) | double | Parameter value to be added |
Add
Adds a parameter with a string value.
| Name | Type | Description |
|---|---|---|
| key (required) | string | Parameter key to be added. |
| value (required) | string | Parameter value to be added |
GetSortedParametersList
Converts the current parameters into a list of key-value pairs.
Query
Find
The Find all object call fetches the list of all objects owned by a particular user account.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = client.Stack().Query().Limit(5).Find();FindAsync
The Find all object call fetches the list of all objects owned by a particular user account.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
ContentstackResponse contentstackResponse = await client.Stack().Query().Limit(5).FindAsync();IncludeCount
The ‘include_count’ parameter returns the total number of object related to the user.
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack().Query().IncludeCount();Limit
The ‘limit’ parameter will return a specific number of Objects in the output.
| Name | Type | Description |
|---|---|---|
| value (required) | Double | Number of object in limit. |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack().Query().Limit(5);Skip
The ‘skip’ parameter will skip a specific number of Object in the output.
| Name | Type | Description |
|---|---|---|
| value (required) | Double | Number of object to skip |
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Query query = client.Stack().Query().Skip(5);StringListParameterValue
String list parameter value.
| Name | Type | Description |
|---|---|---|
| Value | List<string> | List of strings value of the parameter. |
StringListParameterValue
Constructs ParameterValue for a list of strings.
| Name | Type | Description |
|---|---|---|
| values | List<String> | List of string value for the query parameter. |
StringParameterValue
String parameter value.
| Name | Type | Description |
|---|---|---|
| Value | string | String value of the parameter. |
StringParameterValue
Constructs ParameterValue for a single string.
| Name | Type | Description |
|---|---|---|
| value | string | Value for the query parameter. |
Bulk Operations
The Contentstack Management .NET SDK provides bulk operation capabilities to perform actions on multiple entries and assets simultaneously, enabling efficient large-scale content management.
BulkPublish
The BulkPublish method publishes multiple entries and assets simultaneously across specified locales and environments.
| Name | Type | Description |
|---|---|---|
| publishDetails | BulkPublishDetails | Specify entry or asset UIDs along with the target locales and publishing environments. If omitted, the system defaults to the primary locale. |
| skipWorkflowStage | Boolean | Set to true to publish entries that are in workflow stages eligible under the applied publish rules. |
| approvals | Boolean | Set to true to publish entries that do not require an approval to be published. |
| apiVersion | String | Specify the API Version in Headers |
Example:
var bulkOperation = stack.BulkOperation();
var publishDetails = new BulkPublishDetails
{
Entries = new List<BulkPublishEntry>
{
new BulkPublishEntry
{
Uid = "entry_uid_1",
ContentType = "content_type_uid",
Version = 1,
Locale = "en-us"
},
new BulkPublishEntry
{
Uid = "entry_uid_2",
ContentType = "content_type_uid",
Version = 2,
Locale = "en-us"
}
},
Assets = new List<BulkPublishAsset>
{
new BulkPublishAsset { Uid = "asset_uid_1" },
new BulkPublishAsset { Uid = "asset_uid_2" }
},
Locales = new List<string> { "en-us", "en-gb" },
Environments = new List<string> { "environment_uid" }
};
ContentstackResponse response = bulkOperation.Publish(publishDetails);BulkPublishAsync
The BulkPublish method publishes multiple entries and assets simultaneously across specified locales and environments.
| Name | Type | Description |
|---|---|---|
| publishDetails | BulkPublishDetails | Specify entry or asset UIDs along with the target locales and publishing environments. If omitted, the system defaults to the primary locale. |
| skipWorkflowStage | Boolean | Set to true to publish entries that are in workflow stages eligible under the applied publish rules. |
| approvals | Boolean | Set to true to publish entries that do not require an approval to be published. |
| apiVersion | String | Specify the API Version in Headers |
Example:
var bulkOperation = stack.BulkOperation();
var publishDetails = new BulkPublishDetails
{
Entries = new List<BulkPublishEntry>
{
new BulkPublishEntry
{
Uid = "entry_uid_1",
ContentType = "content_type_uid",
Version = 1,
Locale = "en-us"
},
new BulkPublishEntry
{
Uid = "entry_uid_2",
ContentType = "content_type_uid",
Version = 2,
Locale = "en-us"
}
},
Assets = new List<BulkPublishAsset>
{
new BulkPublishAsset { Uid = "asset_uid_1" },
new BulkPublishAsset { Uid = "asset_uid_2" }
},
Locales = new List<string> { "en-us", "en-gb" },
Environments = new List<string> { "environment_uid" }
};
ContentstackResponse response = await bulkOperation.PublishAsync(publishDetails);BulkUnpublish
The BulkUnpublish method allows you to unpublish multiple entries and assets simultaneously across selected locales and environments.
| Name | Type | Description |
|---|---|---|
| publishDetails | BulkPublishDetails | Specify entry or asset UIDs along with the target locales and unpublishing environments. If omitted, the system defaults to the primary locale. |
| skipWorkflowStage | Boolean | Set to true to unpublish entries that are in workflow stages eligible under the applied publish rules. |
| approvals | Boolean | Set to true to publish entries that do not require an approval to be published. |
| apiVersion | String | Specify the API Version in Headers |
Example:
var bulkOperation = stack.BulkOperation();
var unpublishDetails = new BulkPublishDetails
{
Entries = new List<BulkPublishEntry>
{
new BulkPublishEntry
{
Uid = "entry_uid_1",
ContentType = "content_type_uid",
Locale = "en-us"
},
new BulkPublishEntry
{
Uid = "entry_uid_2",
ContentType = "content_type_uid",
Locale = "en-us"
}
},
Assets = new List<BulkPublishAsset>
{
new BulkPublishAsset { Uid = "asset_uid_1" }
},
Locales = new List<string> { "en-us" },
Environments = new List<string> { "environment_uid" }
};
ContentstackResponse response = bulkOperation.Unpublish(unpublishDetails);BulkUnpublishAsync
The BulkUnpublishAsync method allows you to unpublish multiple entries and assets simultaneously across selected locales and environments.
| Name | Type | Description |
|---|---|---|
| publishDetails | BulkPublishDetails | Specify entry or asset UIDs along with the target locales and unpublishing environments. If omitted, the system defaults to the primary locale. |
| skipWorkflowStage | Boolean | Set to true to unpublish entries that are in workflow stages eligible under the applied publish rules. |
| approvals | Boolean | Set to true to publish entries that do not require an approval to be published. |
| apiVersion | String | Specify the API Version in Headers |
Example:
var bulkOperation = stack.BulkOperation();
var unpublishDetails = new BulkPublishDetails
{
Entries = new List<BulkPublishEntry>
{
new BulkPublishEntry
{
Uid = "entry_uid_1",
ContentType = "content_type_uid",
Locale = "en-us"
},
new BulkPublishEntry
{
Uid = "entry_uid_2",
ContentType = "content_type_uid",
Locale = "en-us"
}
},
Assets = new List<BulkPublishAsset>
{
new BulkPublishAsset { Uid = "asset_uid_1" }
},
Locales = new List<string> { "en-us" },
Environments = new List<string> { "environment_uid" }
};
ContentstackResponse response = await bulkOperation.UnpublishAsync(unpublishDetails);BulkDelete
The BulkDelete method allows you to delete multiple entries and assets simultaneously across specified locales and environments.
| Name | Type | Description |
|---|---|---|
| data | BulkDeleteDetails | Data containing the entries and assets to be deleted. |
Example:
var deleteDetails = new BulkDeleteDetails
{
Entries = new List<BulkDeleteEntry>
{
new BulkDeleteEntry
{
Uid = "entry_uid_1",
ContentType = "content_type_uid",
Locale = "en-us"
},
new BulkDeleteEntry
{
Uid = "entry_uid_2",
ContentType = "content_type_uid",
Locale = "en-us"
}
},
Assets = new List<BulkDeleteAsset>
{
new BulkDeleteAsset { Uid = "asset_uid_1" },
new BulkDeleteAsset { Uid = "asset_uid_2" }
}
};
ContentstackResponse response = bulkOperation.Delete(deleteDetails);Bulk Workflow Update
The update method updates an existing workflow with the specified configuration details
| Name | Type | Description |
|---|---|---|
| data | BulkWorkflowUpdateBody | Data containing the entries and assets to be added. |
Example:
var updateBody = new BulkWorkflowUpdateBody
{
Entries = new List<BulkWorkflowEntry>
{
new BulkWorkflowEntry
{
Uid = "entry_uid",
ContentType = "content_type_uid",
Locale = "en-us"
}
},
Workflow = new BulkWorkflowStage
{
Uid = "workflow_stage_uid",
Comment = "Please review this content",
DueDate = "2023-12-15",
Notify = true,
AssignedTo = new List<BulkWorkflowUser>
{
new BulkWorkflowUser
{
Uid = "user_uid",
Name = "John Doe",
Email = "[email protected]"
}
},
AssignedByRoles = new List<BulkWorkflowRole>
{
new BulkWorkflowRole
{
Uid = "role_uid",
Name = "Content Editor"
}
}
}
};
ContentstackResponse response = bulkOperation.Update(updateBody);Bulk Workflow UpdateAsync
The updateAsync method updates an existing workflow with the specified configuration details
| Name | Type | Description |
|---|---|---|
| data | BulkWorkflowUpdateBody | Data containing the entries and assets to be added. |
Example:
var updateBody = new BulkWorkflowUpdateBody
{
Entries = new List<BulkWorkflowEntry>
{
new BulkWorkflowEntry
{
Uid = "entry_uid",
ContentType = "content_type_uid",
Locale = "en-us"
}
},
Workflow = new BulkWorkflowStage
{
Uid = "workflow_stage_uid",
Comment = "Please review this content",
DueDate = "2023-12-15",
Notify = true,
AssignedTo = new List<BulkWorkflowUser>
{
new BulkWorkflowUser
{
Uid = "user_uid",
Name = "John Doe",
Email = "[email protected]"
}
},
AssignedByRoles = new List<BulkWorkflowRole>
{
new BulkWorkflowRole
{
Uid = "role_uid",
Name = "Content Editor"
}
}
}
};
ContentstackResponse response = bulkOperation.Update(updateBody);BulkDeleteAsync
The BulkDeleteAsync method allows you to delete multiple entries and assets simultaneously across specified locales and environments.
| Name | Type | Description |
|---|---|---|
| data | BulkDeleteDetails | Data containing the entries and assets to be deleted. |
Example:
var deleteDetails = new BulkDeleteDetails
{
Entries = new List<BulkDeleteEntry>
{
new BulkDeleteEntry
{
Uid = "entry_uid_1",
ContentType = "content_type_uid",
Locale = "en-us"
},
new BulkDeleteEntry
{
Uid = "entry_uid_2",
ContentType = "content_type_uid",
Locale = "en-us"
}
},
Assets = new List<BulkDeleteAsset>
{
new BulkDeleteAsset { Uid = "asset_uid_1" },
new BulkDeleteAsset { Uid = "asset_uid_2" }
}
};
// Execute bulk delete
ContentstackResponse response = await bulkOperation.DeleteAsync(deleteDetails);Bulk AddItemsAsync
The AddItemsAsync method adds multiple entries and assets to a release in a single operation.
| Name | Type | Description |
|---|---|---|
| data | BulkAddItemsData | Data containing the entries and assets to be deleted. |
| bulkVersion | String | The bulk operation version. |
Example:
var releaseData = new BulkAddItemsData
{
Release = "release_uid",
Action = "publish",
Locale = new List<string> { "en-us", "en-gb" },
Reference = true,
Items = new List<BulkReleaseItem>
{
new BulkReleaseItem
{
ContentTypeUid = "content_type_uid",
Uid = "entry_uid",
Version = 1,
Locale = "en-us",
Title = "Sample Entry"
},
new BulkReleaseItem
{
ContentTypeUid = "content_type_uid",
Uid = "entry_uid_2",
Version = 2,
Locale = "en-gb",
Title = "Sample Entry 2"
}
}
};
ContentstackResponse response = await bulkOperation.AddItemsAsync(releaseData, "2.0");Bulk UpdateItems
The UpdateItems method updates multiple entries and assets to a release in a single operation.
| Name | Type | Description |
|---|---|---|
| data | BulkAddItemsData | Data containing the entries and assets to be deleted. |
| bulkVersion | String | The bulk operation version. |
Example:
var itemsData = new BulkAddItemsData
{
Items = new List<BulkAddItem>
{
new BulkAddItem
{
Uid = "entry_uid_1",
ContentType = "blog_post"
},
new BulkAddItem
{
Uid = "entry_uid_2",
ContentType = "product"
},
new BulkAddItem
{
Uid = "entry_uid_3",
ContentType = "article"
}
}
};
// Update items in release with specific bulk version
ContentstackResponse response = bulkOperation.UpdateItems(itemsData, "2.0");Bulk AddItems
The AddItems method adds multiple entries and assets to a release in a single operation.
| Name | Type | Description |
|---|---|---|
| data | BulkAddItemsData | Data containing the entries and assets to be deleted. |
| bulkVersion | String | The bulk operation version. |
Example:
var releaseData = new BulkAddItemsData
{
Release = "release_uid",
Action = "publish",
Locale = new List<string> { "en-us", "en-gb" },
Reference = true,
Items = new List<BulkReleaseItem>
{
new BulkReleaseItem
{
ContentTypeUid = "content_type_uid",
Uid = "entry_uid",
Version = 1,
Locale = "en-us",
Title = "Sample Entry"
},
new BulkReleaseItem
{
ContentTypeUid = "content_type_uid",
Uid = "entry_uid_2",
Version = 2,
Locale = "en-gb",
Title = "Sample Entry 2"
}
}
};
ContentstackResponse response = bulkOperation.AddItems(releaseData, "2.0");Bulk UpdateItemsAsync
The UpdateItemsAsync method updates multiple entries and assets to a release in a single operation.
| Name | Type | Description |
|---|---|---|
| data | BulkAddItemsData | Data containing the entries and assets to be deleted. |
| bulkVersion | String | The bulk operation version. |
Example:
var itemsData = new BulkAddItemsData
{
Items = new List<BulkAddItem>
{
new BulkAddItem
{
Uid = "entry_uid_1",
ContentType = "blog_post"
},
new BulkAddItem
{
Uid = "entry_uid_2",
ContentType = "product"
},
new BulkAddItem
{
Uid = "entry_uid_3",
ContentType = "article"
}
}
};
ContentstackResponse response = await bulkOperation.UpdateItemsAsync(itemsData, "2.0");JobStatusAsync
The JobStatusAsync method retrieves the status of a bulk operation using its job UID.
| Name | Type | Description |
|---|---|---|
| job_id | String | The UID of the bulk job |
| bulkVersion | String | The bulk operation version. |
Example:
string jobId = "job_id_from_bulk_operation"; ContentstackResponse response = bulkOperation.JobStatus(jobId); ContentstackResponse responseWithVersion = await bulkOperation.JobStatusAsync(jobId, "2.0");
JobStatus
The JobStatus method retrieves the status of a bulk operation using its job UID.
| Name | Type | Description |
|---|---|---|
| job_id | String | The UID of the bulk job |
| bulkVersion | String | The bulk operation version. |
Example:
string jobId = "job_id_from_bulk_operation"; ContentstackResponse response = bulkOperation.JobStatus(jobId); ContentstackResponse responseWithVersion = bulkOperation.JobStatus(jobId, "2.0");
Taxonomy
The Taxonomy class allows you to organize and categorize content using a hierarchical structure of terms. It serves as the central manager for taxonomy-level operations such as create, manage, export, or retrieve taxonomies, within a specific Stack.
Initialization
To interact with taxonomies, initialize the class through your stack instance.
- Syntax:
stack.Taxonomy(string uid = null)
- Returns:
- Type: Taxonomy
- Description: Returns a Taxonomy instance.
UID and Request Scope
- The uid determines the request scope. The SDK uses it to bind the Taxonomy instance either to the collection (/taxonomies) or to a single taxonomy (/taxonomies/{uid}), and validates this before sending the request. Using the wrong scope throws InvalidOperationException.
- Use collection scope by calling stack.Taxonomy() (omit or pass null for uid). This maps to /taxonomies and supports:
- Create / CreateAsync
- Query().Find() / Query().FindAsync()
- Import / ImportAsync
- Use single-taxonomy scope by calling stack.Taxonomy("<TAXONOMY_UID>") with a non-empty UID. This maps to /taxonomies/{uid}.
Method Index
| Method Name | Description |
|---|---|
| Find() / FindAsync() | Queries and retrieves a list of taxonomies with optional filters. |
| Create() / CreateAsync() | Creates a new taxonomy within the stack. |
| Update() / UpdateAsync() | Updates the details of an existing taxonomy. |
| Fetch() / FetchAsync() | Retrieves the complete details of a single taxonomy. |
| Delete() / DeleteAsync() | Permanently removes a taxonomy from the stack. |
| Export() / ExportAsync() | Exports taxonomy data as a payload. |
| Locales() / LocalesAsync() | Retrieves the localized versions for the targeted taxonomy. |
| Localize() / LocalizeAsync() | Creates or updates a localized version of the taxonomy. |
| Import() / ImportAsync() | Imports a taxonomy from a file stream. |
| Terms() | Returns a Term instance scoped to this taxonomy. |
Synchronous vs Asynchronous Methods
Synchronous
- Blocks the executing thread until the API responds.
- Use for simple console scripts or background workers where blocking is acceptable.
Asynchronous (Async)
- Releases the thread while waiting for the network response.
- Recommended for modern .NET apps (e.g., ASP.NET Core) and UI apps.
- Ensures better scalability and responsiveness.
Common Usage Example
Shows an end-to-end async workflow to initialize Taxonomy, authenticate the client, target a Stack, and create a "Categories" taxonomy with basic error handling.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Services.Models;
using Contentstack.Management.Core.Exceptions;
namespace ContentstackExample
{
class Program
{
static async Task Main(string[] args)
{
try
{
// Initialize the Contentstack client with the authentication token
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
// Target the specific stack using its API key
Stack stack = client.Stack("<API_KEY>");
// Define the payload for the new taxonomy
TaxonomyModel model = new TaxonomyModel
{
Uid = "<TAXONOMY_UID>",
Name = "Categories",
Description = "Global categories taxonomy"
};
// Optional query parameters (merged as query string when non-empty); pass null if none
ContentstackResponse response = await stack.Taxonomy().CreateAsync(model, collection: null);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("Taxonomy created successfully.");
}
else
{
Console.WriteLine($"Taxonomy create failed: HTTP {(int)response.StatusCode}");
}
}
catch (ContentstackException ex)
{
Console.WriteLine($"Contentstack Error: {ex.ErrorMessage}");
}
catch (Exception ex)
{
Console.WriteLine($"System Error: {ex.Message}");
}
}
}
}Find / FindAsync
The Find and FindAsync methods retrieve all taxonomies available in the stack.
Note Results are paginated, so a single Find() / FindAsync() may not return every taxonomy. Refer to the Content Management API documentation for page size and maximum limit.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query modifiers for Query().Find() provide values to refine retrieval results using applied filters. |
Use the Query fluent helpers or pass a ParameterCollection into Find / FindAsync to page results (for example limit, skip, and include_count).
Example:
The following example shows how to asynchronously query the stack for taxonomies, page with Limit / Skip, and read the taxonomies array from the response.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Queryable;
using Contentstack.Management.Core.Exceptions;
using Newtonsoft.Json;
namespace ContentstackExample
{
// GET /taxonomies → { "taxonomies": [ ... ] }
class TaxonomiesResponseModel
{
[JsonProperty("taxonomies")]
public List<TaxonomyModel> Taxonomies { get; set; }
}
class Program
{
static async Task Main(string[] args)
{
try
{
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Merge extra query params: .FindAsync(new ParameterCollection { ... })
ContentstackResponse response = await stack.Taxonomy().Query()
.Limit(20)
.Skip(0)
.FindAsync();
if (!response.IsSuccessStatusCode)
{
Console.WriteLine($"Request failed: HTTP {(int)response.StatusCode}");
return;
}
var wrapper = response.OpenTResponse<TaxonomiesResponseModel>();
if (wrapper?.Taxonomies != null)
{
foreach (var taxonomy in wrapper.Taxonomies)
{
Console.WriteLine($"{taxonomy.Uid}: {taxonomy.Name}");
}
}
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}
}
}
}Create / CreateAsync
The Create and CreateAsync actions add a new taxonomy to the stack.
| Name | Type | Description |
|---|---|---|
| model (required) | TaxonomyModel | The taxonomy payload for Create(). Provide UID, name, and optionally description to create a new taxonomy entity. |
| collection | ParameterCollection | Defines optional query parameters for the creation request. Provide values to modify the default API response. |
The following example shows how to asynchronously create a new taxonomy with a specific UID and Name.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Construct the payload with required taxonomy properties
TaxonomyModel model = new TaxonomyModel
{
Uid = "<TAXONOMY_UID>",
Name = "Product Taxonomy"
};
// Execute the creation request (second argument: optional ParameterCollection, or null)
ContentstackResponse response = await stack.Taxonomy().CreateAsync(model, collection: null);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("Taxonomy created successfully.");
}
else
{
Console.WriteLine($"Taxonomy create failed: HTTP {(int)response.StatusCode}");
}
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}Update / UpdateAsync
The Update and UpdateAsync actions modify the details of an existing taxonomy.
Update Behavior and UID Requirement
- The taxonomy is identified only by the UID passed to stack.Taxonomy("<TAXONOMY_UID>"), which is used in the request path PUT /taxonomies/{uid}. The SDK does not infer the target from TaxonomyModel.
- You must call Update or UpdateAsync with a non-empty UID. Calling stack.Taxonomy() without a UID throws InvalidOperationException before any request is sent.
- You can set TaxonomyModel.Uid in the request body for consistency, but it does not determine which taxonomy is updated.
Deserializing the Response
- ContentstackResponse does not include a Result property.
- Use OpenTResponse<T>() to deserialize the response, or OpenJObjectResponse() / OpenResponse() for raw access.
- The API wraps the response inside a taxonomy field, so define a DTO with [JsonProperty("taxonomy")] to match the structure.
| Name | Type | Description |
|---|---|---|
| model (required) | TaxonomyModel | Defines fields (Name, Description) for Update(). Provide values to update the taxonomy. |
| collection | ParameterCollection | Defines optional query parameters for the update request. Provide values to modify the API response. |
The following example shows how to update the name and description of an explicitly targeted taxonomy and verify the persisted values from the response body. It assumes a top-level statements entry file. If you use a classic Main method instead, define TaxonomyResponseEnvelope in another source file (or above Main in the same file) and invoke the same logic from Main.
using System;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Define the properties to be updated
TaxonomyModel model = new TaxonomyModel
{
Name = "<UPDATED_NAME>",
Description = "<UPDATED_DESCRIPTION>"
};
// Target the taxonomy by UID and apply the updates (optional ParameterCollection as second arg)
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").UpdateAsync(model, collection: null);
if (response.IsSuccessStatusCode)
{
TaxonomyResponseEnvelope body = response.OpenTResponse<TaxonomyResponseEnvelope>();
TaxonomyModel updated = body?.Taxonomy;
if (updated != null
&& updated.Name == "<UPDATED_NAME>"
&& updated.Description == "<UPDATED_DESCRIPTION>")
{
Console.WriteLine($"Taxonomy updated successfully (uid: {updated.Uid}, updated_at: {updated.UpdatedAt}).");
}
else
{
Console.WriteLine("Update reported success but response body did not match expected fields.");
}
}
else
{
Console.WriteLine($"Taxonomy update failed: HTTP {(int)response.StatusCode}");
}
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}
catch (InvalidOperationException ex)
{
Console.WriteLine($"Invalid operation: {ex.Message}");
}
// Matches the API envelope: { "taxonomy": { ... } }. In top-level programs, declare helper types after statements.
public class TaxonomyResponseEnvelope
{
[JsonProperty("taxonomy")]
public TaxonomyModel Taxonomy { get; set; }
}Fetch / FetchAsync
The Fetch and FetchAsync actions retrieve the details of a single, specific taxonomy.
Fetching a Taxonomy (UID Requirement)
- The taxonomy returned is determined only by the UID passed to stack.Taxonomy("<TAXONOMY_UID>"), which maps to GET /taxonomies/{uid}.
- Calling Fetch or FetchAsync on stack.Taxonomy() without a UID throws InvalidOperationException before any request is sent.
- The same entry point without a UID is used for collection operations such as create or query, not for fetching a single taxonomy.
Handling the Response
- ContentstackResponse does not include a Result property.
- Use OpenTResponse<T>() to deserialize the response, or OpenJObjectResponse() / OpenResponse() for raw access.
- The response is wrapped in a taxonomy field, so define a DTO with [JsonProperty("taxonomy")] to match the payload.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Defines optional query parameters for Fetch(). Provide values to modify the retrieved payload. |
The following example fetches a taxonomy by UID and reads the returned TaxonomyModel from the body. It assumes top-level statements. If you use a classic Main method, define TaxonomyResponseEnvelope in another source file (or above Main) and call the same logic from Main.
using System;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").FetchAsync(collection: null);
if (response.IsSuccessStatusCode)
{
TaxonomyResponseEnvelope body = response.OpenTResponse<TaxonomyResponseEnvelope>();
TaxonomyModel taxonomy = body?.Taxonomy;
if (taxonomy != null && taxonomy.Uid == "<TAXONOMY_UID>")
{
Console.WriteLine($"Fetched taxonomy: {taxonomy.Name} (updated_at: {taxonomy.UpdatedAt}).");
}
else
{
Console.WriteLine("Fetch reported success but response body was missing or did not match the requested UID.");
}
}
else
{
Console.WriteLine($"Taxonomy fetch failed: HTTP {(int)response.StatusCode}");
}
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}
catch (InvalidOperationException ex)
{
Console.WriteLine($"Invalid operation: {ex.Message}");
}
// Matches the API envelope: { "taxonomy": { ... } }. In top-level programs, declare helper types after statements.
public class TaxonomyResponseEnvelope
{
[JsonProperty("taxonomy")]
public TaxonomyModel Taxonomy { get; set; }
}Delete / DeleteAsync
The Delete and DeleteAsync actions remove a taxonomy from the stack.
Warning Deleting a taxonomy is permanent and cannot be undone. This action removes all associated terms and breaks their links with entries. Use only when you intend to remove this structure from the stack.
Validation
- You must call Delete or DeleteAsync on stack.Taxonomy("<TAXONOMY_UID>"). Calling stack.Taxonomy() without a UID throws InvalidOperationException before the request is sent.
- If the API rejects the request (for example, due to permissions, dependencies, or a missing resource), the client throws ContentstackErrorException.
- Errors are not returned as a failed ContentstackResponse. Inspect StatusCode, ErrorMessage, and ErrorCode on the exception.
Behavior
- Optional flags are sent as query parameters using ParameterCollection.
- Boolean values are serialized as lowercase (true / false) in the URL.
- For example, to force delete (if supported):
ParameterCollection collection = new ParameterCollection(); collection.Add("force", true); // becomes ?force=true ContentstackResponse response = await stack .Taxonomy("<TAXONOMY_UID>") .DeleteAsync(collection); - Use of parameters not supported by the Management API for taxonomies may be ignored or throw errors.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Defines optional query parameters for Delete(). Provide values to control deletion behavior. |
The following example removes a taxonomy by UID. It omits collection for a plain delete and adds a ParameterCollection with force only when your API contract requires it.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Execute the deletion request for a targeted taxonomy asynchronously
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").DeleteAsync(collection: null);
Console.WriteLine("Taxonomy deleted successfully.");
}
catch (ContentstackErrorException ex)
{
Console.WriteLine($"API error ({(int)ex.StatusCode}): {ex.ErrorMessage}");
}
catch (InvalidOperationException ex)
{
Console.WriteLine($"Invalid operation: {ex.Message}");
}Export / ExportAsync
The Export and ExportAsync actions retrieve a full export of a single taxonomy for backup, migration, or external processing.
The response body is the raw export payload (JSON document or CSV text). The SDK does not provide a typed model. Use OpenResponse(), OpenJObjectResponse(), or OpenTResponse<T>() with your own DTOs. Inspect ContentType and ContentLength to distinguish JSON vs CSV.
Validation
- Calling stack.Taxonomy() without a UID and then Export / ExportAsync throws InvalidOperationException before the request.
- If the client is not authorized, ThrowIfNotLoggedIn() is thrown before the request.
- Unsupported ParameterCollection value types can throw ContentstackException.
- Passing null for collection is valid and only fails at the API or during response parsing.
Behavior
- The taxonomy is selected only by the UID passed to stack.Taxonomy("<TAXONOMY_UID>").
- Each call maps to a single GET /taxonomies/{uid}/export request.
- Optional flags are sent via ParameterCollection as query parameters. Supported keys and behavior are defined by the Management API.
- The response shape depends on the API.
- The response is not written to disk automatically. Persist the output from OpenResponse() if needed.
- Use Import / ImportAsync to re-upload exports, and Fetch / FetchAsync for live taxonomy data without export.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Defines optional query parameters for the Export() method. Provide values to control exported data. |
The following example requests a JSON export using an optional format query parameter, reads the body as JSON, and handles API and client-side errors.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Exceptions;
using Contentstack.Management.Core.Queryable;
using Newtonsoft.Json.Linq;
try
{
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
ParameterCollection collection = new ParameterCollection();
collection.Add("format", "json");
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").ExportAsync(collection);
JObject json = response.OpenJObjectResponse();
Console.WriteLine($"Export succeeded. Content-Type: {response.ContentType}, length: {response.ContentLength}");
Console.WriteLine(json.ToString(Newtonsoft.Json.Formatting.None));
}
catch (ContentstackErrorException ex)
{
Console.WriteLine($"API error ({(int)ex.StatusCode}): {ex.ErrorMessage}");
}
catch (InvalidOperationException ex)
{
Console.WriteLine($"Invalid operation: {ex.Message}");
}Locales / LocalesAsync
The Locales and LocalesAsync actions return the localized versions available for the targeted taxonomy.
The response body is raw JSON from the API. The SDK does not provide a dedicated typed model for this response.
Validation
- Unsupported ParameterCollection value types can throw ContentstackException.
- Passing null for collection is valid. Some query keys or values may be ignored by the API or only fail after the server response.
Behavior
- Each call maps to a single HTTP GET request.
- The response shape depends on the Management API. Do not assume a fixed schema unless using your own DTOs.
- Use Localize / LocalizeAsync to create or update localized content.
- Use stack.Locale().Query() to list stack-level locale definitions (separate from taxonomy or term locale payloads).
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Defines optional query parameters for Locales(). Provide values to control the returned locale list. |
The following example builds a client and stack, calls LocalesAsync for one taxonomy UID, reads JSON with OpenJObjectResponse(), and handles API failures and invalid SDK targeting.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Exceptions;
using Newtonsoft.Json.Linq;
try
{
ContentstackClient client = new ContentstackClient("AUTHTOKEN");
Stack stack = client.Stack("APIKEY");
ContentstackResponse response = await stack.Taxonomy("TAXONOMYUID").LocalesAsync();
JObject json = response.OpenJObjectResponse();
Console.WriteLine($"HTTP {(int)response.StatusCode}; taxonomies node present: {json["taxonomies"] != null}");
}
catch (ContentstackErrorException ex)
{
Console.WriteLine($"API error ({(int)ex.StatusCode}): {ex.ErrorMessage}");
}
catch (InvalidOperationException ex)
{
Console.WriteLine($"Invalid operation: {ex.Message}");
}Localize / LocalizeAsync
The Localize and LocalizeAsync actions create or update the localized fields for an existing taxonomy, using optional query parameters (typically locale) to select the target locale.
Validation
- A non-empty taxonomy UID must be provided; otherwise, stack.Taxonomy() throws InvalidOperationException.
- Passing null for model throws ArgumentNullException when the internal CreateUpdateService is constructed.
- You can pass null for collection. The SDK does not validate query parameters and defers validation to the API.
Behavior
- Add entries to ParameterCollection to send query parameters (for example, locale). The SDK forwards these values without validation.
- The SDK sends one HTTP POST request to /taxonomies/{taxonomy_uid} with the body { "taxonomy": … }. Query parameters are included only when collection is non-empty.
- The API returns a JSON response. Deserialize it using OpenTResponse<T>() or similar if needed.
- Call Locales / LocalesAsync to read locale data, and call stack.Locale().Query() to list available locale codes.
| Name | Type | Description |
|---|---|---|
| model (required) | TaxonomyModel | Defines the localized taxonomy data for Localize(). Provide values to send the localized payload to the server. |
| collection (required) | ParameterCollection | Defines query parameters for Localize() that specify the target locale. Provide values to ensure the payload is assigned to the correct locale code. |
The following example shows how to create a localized version for the taxonomy targeting the fr-fr locale.
Note The targeted locale must exist on the stack.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Queryable;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Define the translated properties for the taxonomy
TaxonomyModel model = new TaxonomyModel
{
Uid = "<TAXONOMY_UID>",
Name = "Catégories",
Description = "Catégories globales"
};
// Initialize query parameters to target the specific locale (e.g., 'fr-fr')
ParameterCollection collection = new ParameterCollection();
collection.Add("locale", "fr-fr");
// Execute the localization request asynchronously passing both model and params
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").LocalizeAsync(model, collection);
// Output success message
Console.WriteLine("Taxonomy localized.");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}Import / ImportAsync
The Import and ImportAsync actions upload a taxonomy configuration file into the stack via multipart form data.
Validation
- Use stack.Taxonomy() (no UID) for import. Calling stack.Taxonomy("TAXONOMYUID").Import(...) throws InvalidOperationException before the request.
- Passing null for the model parameter throws ArgumentNullException when constructing the upload service.
- Provide valid inputs to TaxonomyImportModel:
- filePath must be non-null and accessible. Invalid paths or permissions throw IOException (or related System.IO exceptions).
- A null stream throws ArgumentNullException.
- Passing a null or empty collection does not throw. The API validates any query parameters after the request.
| Name | Type | Description |
|---|---|---|
| model (required) | TaxonomyImportModel | Defines the file stream and filename for Import(). Provide values to upload the taxonomy configuration file to the stack. |
| collection | ParameterCollection | Defines optional query parameters for Import(). Provide values to control import processing rules. |
The following example shows how to read a taxonomy JSON file from the local disk and import it into the stack.
using System;
using System.IO;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Open the local JSON file containing the taxonomy data as a stream
using Stream stream = File.OpenRead("path/to/taxonomy.json");
// Assign the file stream and expected file name to the import model
TaxonomyImportModel model = new TaxonomyImportModel(stream, "taxonomy.json");
// Execute the import process asynchronously
ContentstackResponse response = await stack.Taxonomy().ImportAsync(model);
// Output success message
Console.WriteLine("Taxonomy imported successfully.");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}
catch (IOException ex)
{
Console.WriteLine($"File Error: {ex.Message}");
}Terms
The Terms() method returns a Term instance scoped to the parent taxonomy. It does not make an API call.
The SDK constructs the resourcePath based on scope:
- Collection scope: /taxonomies/{taxonomy_uid}/terms
- Single-term scope: /taxonomies/{taxonomy_uid}/terms/{term_uid}
Use this method to navigate to term-level APIs within a taxonomy.
Note The Terms() method acts as a navigation layer and does not execute an API request. It returns a Term instance scoped to the parent taxonomy, which is used to perform term-level operations such as Create(), Fetch(), Move(), Delete(), and Descendants().
Validation
- Calling Terms() on stack.Taxonomy("TAXONOMYUID") with an empty taxonomy UID throws InvalidOperationException before any HTTP request.
- Pass null or omit termUid to use collection scope. Terms() does not throw in this case.
- Pass a non-empty termUid only when you need single-term scope. Methods that require a term UID (for example Descendants) throw InvalidOperationException if called on a collection-scoped instance.
- The SDK does not validate whether termUid exists. Invalid or unknown UIDs produce ContentstackErrorException only when a terminal API call is executed.
- Passing an empty string for termUid behaves like null (collection scope) for path construction. Methods requiring a term UID still fail client-side.
Behavior
- Each terminal method you call on the returned Term maps to one HTTP request.
- The SDK does not fetch data automatically; use Query().Find() / FindAsync() for listing and handle pagination explicitly if supported.
| Name | Type | Description |
|---|---|---|
| termUid | string | Defines the term UID for Terms(termUid). Provide a value to target a specific term, or use null to operate on a collection. |
The following example shows how to obtain a general term collection scope versus a single specific term scope.
using System;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
// Initialize the Contentstack client with the authentication token
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
// Target the specific stack using its API key
Stack stack = client.Stack("<API_KEY>");
// Collection Context (returns a Terms instance for creation or multi-item queries)
Term termsCollection = stack.Taxonomy("<TAXONOMY_UID>").Terms();
// Single Term Context (returns a specific Term instance for fetch, update, delete)
Term singleTerm = stack.Taxonomy("<TAXONOMY_UID>").Terms("<TERM_UID>");Term
The Term class represents a taxonomy term (a node in a hierarchy) in the .NET Management SDK. It operates on API paths rooted at /taxonomies/{taxonomy_uid}/terms and /taxonomies/{taxonomy_uid}/terms/{term_uid} when scoped to a single term.
Initialization
Access a Term instance through stack.Taxonomy("TAXONOMYUID").Terms(...) rather than constructing it directly. Once obtained, use the instance to perform create, read, update, delete, hierarchy, move, locale, or search operations.
Syntax: stack.Taxonomy("<TAXONOMY_UID>").Terms(string termUid = null)
Method Index
| Method Name | Description |
|---|---|
| Find() / FindAsync() | Queries and retrieves terms within the specific taxonomy. |
| Create() / CreateAsync() | Creates a new term in the taxonomy. |
| Update() / UpdateAsync() | Updates an existing term's details. |
| Fetch() / FetchAsync() | Fetches details of a single term. |
| Delete() / DeleteAsync() | Deletes a term from the taxonomy. |
| Ancestors() / AncestorsAsync() | Retrieves the ancestor terms of a specific term. |
| Descendants() / DescendantsAsync() | Retrieves the descendant terms of a specific term. |
| Move() / MoveAsync() | Moves a term to a new parent and/or changes its sibling order. |
| Locales() / LocalesAsync() | Gets locales information for the term. |
| Localize() / LocalizeAsync() | Creates or updates a localized version of the term. |
| Search() / SearchAsync() | Performs a typeahead search across terms in all taxonomies. |
Synchronous vs Asynchronous Methods
Synchronous
- Blocks the executing thread until the API responds.
- Use for simple console scripts or background workers where blocking is acceptable.
Asynchronous (Async)
- Releases the thread while waiting for the network response.
- Recommended for modern .NET apps (e.g., ASP.NET Core) and UI apps.
- Ensures better scalability and responsiveness.
Common Usage Example
The following example demonstrates a complete asynchronous workflow to create a new term under a specific taxonomy.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Exceptions;
namespace ContentstackExample
{
class Program
{
static async Task Main(string[] args)
{
try
{
// Initialize the Contentstack client with the authentication token
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
// Target the specific stack using its API key
Stack stack = client.Stack("<API_KEY>");
// Define the payload for the new term, indicating its relationship
TermModel model = new TermModel
{
Uid = "<TERM_UID>",
Name = "Electronics",
ParentUid = null // Set to null for a root term
};
// Target the taxonomy and execute the term creation request asynchronously
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").Terms().CreateAsync(model);
// Output success message
Console.WriteLine("Term Created Successfully");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Contentstack Error: {ex.ErrorMessage}");
}
catch (Exception ex)
{
Console.WriteLine($"System Error: {ex.Message}");
}
}
}
}Find/FindAsync
The Find and FindAsync actions retrieve all terms within a taxonomy.
Note Results are paginated, so a single Find() may not return all items. Use limit and skip to retrieve additional pages.
Validation
- If you omit collection or pass null, the SDK sends only the parameters defined by fluent Query methods (for example Limit, Skip, IncludeCount).
- The SDK forwards all entries in ParameterCollection as query parameters without validation. The API validates parameter names and values and returns errors for invalid or unsupported inputs.
Behavior
- The API returns a JSON response based on the Management API for listing terms. The structure depends on the query parameters you send. Responses typically include a terms array, and may include a total count when you use IncludeCount.
- Each Find or FindAsync call sends one HTTP GET request to /taxonomies/{taxonomy_uid}/terms with query parameters.
- The SDK returns one page per call. It does not automatically retrieve all results. Control pagination using Query.Limit, Query.Skip, and optionally Query.IncludeCount, or pass equivalent parameters through collection. The SDK merges collection with the fluent query before sending the request.
- Use Terms(termUid).Ancestors() or Terms(termUid).Descendants() to retrieve hierarchy data for a specific term instead of Query().Find().
- The SDK does not provide a fluent Depth() method on Query. When the API includes hierarchy data, deserialize it using TermModel, which exposes optional Depth, Ancestors, and Descendants properties.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Defines optional query parameters for Query().Find(). Provide explicit values to control retrieval results using filters. |
The following example lists taxonomy terms with optional pagination and count. It uses OpenTResponse<TermsQueryResponse> with a matching DTO, and demonstrates handling HTTP failures, API errors, and SDK preconditions.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Exceptions;
using Newtonsoft.Json;
// Matches a common list-terms shape: { "terms": [ ... ], "count": ... } when include_count is used.
public sealed class TermsQueryResponse
{
[JsonProperty("terms")]
public List<TermModel> Terms { get; set; }
[JsonProperty("count")]
public int? Count { get; set; }
}
public static class TermsFindExample
{
public static async Task RunAsync()
{
try
{
ContentstackClient client = new ContentstackClient("AUTHTOKEN");
Stack stack = client.Stack("APIKEY");
ContentstackResponse response = await stack
.Taxonomy("TAXONOMYUID")
.Terms()
.Query()
.Limit(50)
.Skip(0)
.IncludeCount()
.FindAsync(collection: null);
if (!response.IsSuccessStatusCode)
{
Console.WriteLine($"Terms query failed: HTTP {(int)response.StatusCode}");
return;
}
var data = response.OpenTResponse<TermsQueryResponse>();
if (data?.Terms != null)
{
foreach (var term in data.Terms)
{
Console.WriteLine(term.Name);
}
}
if (data?.Count is int total)
{
Console.WriteLine($"Total terms (per API): {total}");
}
Console.WriteLine("Terms retrieved.");
}
catch (ContentstackErrorException ex)
{
Console.WriteLine($"API error ({(int)ex.StatusCode}): {ex.ErrorMessage}");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Contentstack error: {ex.Message}");
}
catch (InvalidOperationException ex)
{
Console.WriteLine($"Invalid operation: {ex.Message}");
}
}
}Create / CreateAsync
The Create and CreateAsync actions add a new term node under the designated taxonomy hierarchy.
Validation
- Passing a null model throws ArgumentNullException before the request.
- Call Create / CreateAsync on Terms() (collection scope). Calling it on Terms(termUid) throws InvalidOperationException.
- You can set ParentUid = null to create a root term. The SDK omits null properties from the request body.
Behavior
- Each call sends one HTTP POST to /taxonomies/{taxonomy_uid}/terms with the body { "term": … }.
- The SDK serializes TermModel under the term key and does not derive uid from Name.
- The API returns a JSON response, commonly wrapping the created term under a term field. Define a matching DTO when using OpenTResponse<T>().
- Pass collection to include query parameters. The SDK forwards them without validation and the API defines supported keys.
| Name | Type | Description |
|---|---|---|
| model (required) | TermModel | Defines the term payload (Name, ParentUid, etc.) for Create(). Provide values to create a term node. |
| collection | ParameterCollection | Defines query parameters for the creation request. Provide values to control the default API behavior. |
The following example:
- Creates a root term (ParentUid = null) and a child term using the root’s Uid as ParentUid.
- Calls CreateAsync on collection-scoped Terms().
- Uses unique term UIDs to avoid collisions, and requires valid AUTHTOKEN, APIKEY, and an existing TAXONOMYUID.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Exceptions;
using Newtonsoft.Json;
// Matches a common create-term response body: { "term": { ... } }.
public sealed class TermCreateResponse
{
[JsonProperty("term")]
public TermModel Term { get; set; }
}
public static class TermCreateExample
{
public static async Task RunAsync()
{
try
{
ContentstackClient client = new ContentstackClient("AUTHTOKEN");
Stack stack = client.Stack("APIKEY");
string taxonomyUid = "TAXONOMYUID";
// Root term — ParentUid null (same pattern as SDK integration tests).
string rootUid = "term_root_" + Guid.NewGuid().ToString("N").Substring(0, 8);
var rootModel = new TermModel
{
Uid = rootUid,
Name = "Electronics",
ParentUid = null
};
ContentstackResponse rootResponse = await stack.Taxonomy(taxonomyUid).Terms()
.CreateAsync(rootModel, collection: null);
if (!rootResponse.IsSuccessStatusCode)
{
Console.WriteLine($"Root term create failed: HTTP {(int)rootResponse.StatusCode}");
return;
}
// Child term — ParentUid must reference an existing term in this taxonomy.
string childUid = "term_child_" + Guid.NewGuid().ToString("N").Substring(0, 8);
var childModel = new TermModel
{
Uid = childUid,
Name = "Smartphones",
ParentUid = rootUid
};
ContentstackResponse childResponse = await stack.Taxonomy(taxonomyUid).Terms()
.CreateAsync(childModel, collection: null);
if (!childResponse.IsSuccessStatusCode)
{
Console.WriteLine($"Child term create failed: HTTP {(int)childResponse.StatusCode}");
return;
}
TermCreateResponse created = childResponse.OpenTResponse<TermCreateResponse>();
if (created?.Term != null)
{
Console.WriteLine($"Created child term '{created.Term.Name}' (uid: {created.Term.Uid}).");
}
else
{
Console.WriteLine("Child term create succeeded; response did not deserialize with the sample DTO.");
}
}
catch (ContentstackErrorException ex)
{
Console.WriteLine($"API error ({(int)ex.StatusCode}): {ex.ErrorMessage}");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Contentstack error: {ex.Message}");
}
catch (InvalidOperationException ex)
{
Console.WriteLine($"Invalid operation: {ex.Message}");
}
}
}Update / UpdateAsync
The Update and UpdateAsync actions modify the metadata of an existing term.
| Name | Type | Description |
|---|---|---|
| model (required) | TermModel | Defines the fields to update (e.g., Name) for Update(). Provide values to overwrite existing term data. |
| collection | ParameterCollection | Defines optional query parameters for the update request. Provide values to control the API response. |
The following example shows how to target a specific term and update its display name.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Set the updated term values
TermModel model = new TermModel { Name = "<UPDATED_NAME>" };
// Apply updates asynchronously to the targeted term within the specific taxonomy
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").Terms("<TERM_UID>").UpdateAsync(model);
// Output success message
Console.WriteLine("Term updated.");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}Fetch / FetchAsync
The Fetch and FetchAsync actions retrieve the properties and configuration of a single targeted term.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Defines optional query parameters for Fetch(). Provide values to customize the returned payload. |
The following example shows how to fetch the precise details of a specific term node.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Asynchronously retrieve the payload of a specific term node
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").Terms("<TERM_UID>").FetchAsync();
// Output success message
Console.WriteLine("Term fetched.");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}Delete / DeleteAsync
The Delete and DeleteAsync actions remove a specific term from the taxonomy hierarchy.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Defines optional query parameters (e.g., force) for Delete(). Provide values to control deletion behavior. |
The following example shows how to force-delete a term node even if dependencies exist.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Queryable;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Setup a query parameter collection with the "force" delete setting enabled
ParameterCollection collection = new ParameterCollection();
collection.Add("force", true);
// Asynchronously delete the specified term, enforcing the deletion operation
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").Terms("<TERM_UID>").DeleteAsync(collection);
// Output success message
Console.WriteLine("Term deleted.");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}Ancestors / AncestorsAsync
The Ancestors and AncestorsAsync actions return all parent nodes upward in the taxonomy hierarchy for the given term.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Defines optional query parameters for Ancestors(). Provide explicit values to customize the retrieved ancestor payload. |
The following example shows how to query all parent hierarchy structures above the specified term.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Query for all hierarchical parent terms connected to the specific term node
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").Terms("<TERM_UID>").AncestorsAsync();
// Output success message
Console.WriteLine("Ancestors fetched.");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}Descendants / DescendantsAsync
The Descendants and DescendantsAsync actions return all child nodes downward in the taxonomy hierarchy for the given term.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Defines query parameters for Descendants(). Provide values to customize the retrieved descendant payload. |
The following example shows how to query all underlying child nodes beneath the specified term.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Asynchronously retrieve all child term hierarchies attached to the specific term node
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").Terms("<TERM_UID>").DescendantsAsync();
// Output success message
Console.WriteLine("Descendants fetched.");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}Move / MoveAsync
The Move and MoveAsync actions change the parent and/or sibling order of a specific term within the taxonomy hierarchy.
Note The SDK uses a TermMoveModel (not separate parameters) for move operations. Set ParentUid to the target parent term and optionally Order for sibling position. The SDK serializes this model under the term key in the request body. You can pass optional query parameters (for example, force) using a ParameterCollection as the second argument to Move / MoveAsync.
| Name | Type | Description |
|---|---|---|
| moveModel (required) | TermMoveModel | Defines the target parent UID and optional sibling order for Move(). Provide values to restructure the term hierarchy. |
| collection | ParameterCollection | Defines optional query parameters (for example, force) for Move(). Provide values to control move behavior. |
The following example shows how to move a specific term to a new parent ID at order rank 1.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Queryable;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Configure the restructuring behavior, outlining the target parent and sibling order
TermMoveModel moveModel = new TermMoveModel
{
ParentUid = "<NEW_PARENT_TERM_UID>",
Order = 1
};
// Add 'force' condition to safely allow move bypassing certain dependency constraints
ParameterCollection collection = new ParameterCollection();
collection.Add("force", true);
// Execute the asynchronous term move update applying the configuration
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").Terms("<TERM_UID>").MoveAsync(moveModel, collection);
// Output success message
Console.WriteLine("Term moved successfully.");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}Locales / LocalesAsync
The Locales and LocalesAsync actions return locale information strictly for the specified term.
| Name | Type | Description |
|---|---|---|
| collection | ParameterCollection | Query parameters for Locales(). Provide values to customize the returned locale list. |
The following example shows how to retrieve all locales under which this exact term has been localized.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Request a fetch array representing the localized variants for a specific term
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").Terms("<TERM_UID>").LocalesAsync();
// Output success message
Console.WriteLine("Term Locales fetched.");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}Localize / LocalizeAsync
The Localize and LocalizeAsync actions create or update a localized version of a term node.
| Name | Type | Description |
|---|---|---|
| model (required) | TermModel | Localized term data for Localize(). Provide values to submit the localized payload. |
| collection (required) | ParameterCollection | Query parameters for Localize() to designate the target locale. Provide values to assign the term to the correct locale code. |
The following example shows how to create a localized entry for the specific term targeting the "fr-fr" locale.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Models;
using Contentstack.Management.Core.Queryable;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Set up the localized name or properties for the specific term node
TermModel model = new TermModel { Name = "Électronique" };
// Configure the localization target (in this case, french mapping via 'fr-fr')
ParameterCollection collection = new ParameterCollection();
collection.Add("locale", "fr-fr");
// Push the updated translation payload specific to the targeted term
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").Terms("<TERM_UID>").LocalizeAsync(model, collection);
// Output success message
Console.WriteLine("Term localized.");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}Search / SearchAsync
The Search and SearchAsync actions perform a typeahead search across terms in all taxonomies globally within the stack.
| Name | Type | Description |
|---|---|---|
| typeahead (required) | string | The typeahead search string for Search(). Provide values to locate matching terms globally. |
| collection | ParameterCollection | Query parameters for Search(). Provide values to refine search results. |
The following example shows how to execute a typeahead search to find terms matching a designated string across the stack's taxonomies.
using System;
using System.Threading.Tasks;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Exceptions;
try
{
// Initialize the Contentstack client and target the stack
ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");
Stack stack = client.Stack("<API_KEY>");
// Note: Called on the collection context without a specific term UID.
// Conducts an asynchronous typeahead search through all term collections globally
ContentstackResponse response = await stack.Taxonomy("<TAXONOMY_UID>").Terms().SearchAsync("<TYPEAHEAD_STRING>");
// Output success message
Console.WriteLine("Search completed.");
}
catch (ContentstackException ex)
{
Console.WriteLine($"Error: {ex.ErrorMessage}");
}