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