Creating a Content Type

Creating a Content Type

Using the Administration API in combination with master key authentication you can create content types from your code.

You can create two kinds of content types in Telerik Platform:

After creating a content type you can continue to defining its fields. See Managing Content Type Fields Using the Administration API for more information.

In the Cloud

The following example shows how to create a content type that will store data in the cloud.

var account = new EverliveAccount(AuthorizationStrategy.MasterKey, "master-key-here");

ContentType contentType = new ContentType
{
    Name = "ContentTypeName",
};

account.WorkWith().Application("your-app-id").Types().Create(contentType).ExecuteSync();

The next table lists the properties that you need to include in the request body.

Name Type Description
Name Text The name of the content type that will appear in Telerik Platform. Cannot contain spaces.
Example: BackendTypeName
Title Text (Optional) A user-friendly name that appears in the portal.
Example: Backend Type Name

From a Data Connector

Creating a content type mapped to a data table coming from a Data Connector allows you to manipulate the table data using your Telerik Platform backend.

var account = new EverliveAccount(AuthorizationStrategy.MasterKey, "master-key-here");

ContentType contentType = new ContentType
{
    DataLinkId = dataLinkId,
    Name = "ContentTypeName",
    SourceTypeName = "ExternalName",
};

account.WorkWith().Application("your-app-id").Types().Create(contentType).ExecuteSync();

The next table lists the properties that you need to include in the request body.

Name Type Description
Name Text The name of the content type that will appear in Telerik Platform. Cannot contain spaces.
Example: BackendTypeName
Title Text (Optional) A user-friendly name that appears in the portal.
Example: Backend Type Name
DataLinkId Id The id of the Data Connector of this type
SourceTypeName Text The name of the source type (the table name for relational databases).
Example: Customers

See Also


Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.