ContentType

View as Markdown

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.

NameTypeDescription
model (required)ContentModelling

ContentModelling for creating Content Type.

collectionParameterCollection

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.

NameTypeDescription
model (required)ContentModelling

ContentModelling for creating Content Type.

collectionParameterCollection

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.

NameTypeDescription
collectionParameterCollection

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.

NameTypeDescription
collectionParameterCollection

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.

NameTypeDescription
collectionParameterCollection

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.

NameTypeDescription
collectionParameterCollection

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.

NameTypeDescription
uidstring

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.

NameTypeDescription
model (required)ContentModelling

ContentModelling for updating Content Type.

collectionParameterCollection

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.

NameTypeDescription
model (required)ContentModelling

ContentModelling for updating Content Type.

collectionParameterCollection

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