ManagementToken

View as Markdown

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.

NameTypeDescription
model (required)ManagementTokenModel

ManagementToken Model for creating ManagementToken.

collectionParameterCollection

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.

NameTypeDescription
model (required)ManagementTokenModel

ManagementToken Model for creating ManagementToken.

collectionParameterCollection

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.

NameTypeDescription
collectionParameterCollection

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.

NameTypeDescription
collectionParameterCollection

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.

NameTypeDescription
collectionParameterCollection

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.

NameTypeDescription
collectionParameterCollection

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).

NameTypeDescription
model (required)ManagementTokenModel

ManagementToken Model for creating ManagementToken.

collectionParameterCollection

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).

NameTypeDescription
model (required)ManagementTokenModel

ManagementToken Model for creating ManagementToken.

collectionParameterCollection

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);