Progress will discontinue Telerik Platform on May 10th, 2018. Learn more

Creating Fields

The Administration API allows you to define the structure of a content type programmatically.

Logically, this operation follows the Creating a Content Type Using the RESTful API operation.

Fields for Cloud Content Types

Creating the fields of content types stored in the Telerik Platform cloud is done through the Fields endpoint.

Request:
    POST https://api.everlive.com/v1/Metadata/Applications/your-app-id/Types/type-id-here/Fields
Headers:
    Content-Type: application/json
    Authorization: Masterkey your-master-key-here
Body:
    [{
        "Name": "CustomerName",
        "Title" : "Customer Name",
        "DataType": 1,
        "IsUnique": false
    }, {
        "Name": "CustomerAddress",
        "Title" : "Customer Address",
        "DataType": 1,
        "IsUnique": false
    }]

Response:
    Status: 201 Created
    Content-Type: application/json
Body:
    {
        "Result":
        [{
            "Id": "42eec20b-ce8d-4e47-b1b0-14810fded5a9",
            "CreatedAt": "2014-04-28T08:16:36.312Z"
        }, {
            "Id": "68edc20b-cc8d-4e77-b1b0-14810fded5a3",
            "CreatedAt": "2014-04-28T08:16:36.312Z"

        }]
    }

The next table lists the required and optional field properties that you can include in the request body.

Name Type Description
Name Text The name of the field that will appear in Telerik Platform. Cannot contain spaces.
Example: BackendFieldName
Title Text (Optional) A user-friendly name that appears in the portal.
Example: Backend Field Name
DataType Number Specifies the field type. See Supported Field Types for possible values.
IsUnique Boolean Ensures uniqueness for the field values. You receive an error response if you attempt to create a duplicate value in such a field. Cannot be set for fields that already contain duplicate values. Cannot be set for fields of type Array, Relation (multiple), or system (CreatedAt, ModifiedAt, etc.) plus the following Users fields: Username, Password, PasswordSalt, DisplayName, Role, Email, IsVerified, IdentityProvider, Identity, and VerificationCode. Defaults to false if not included in the request body.

Fields for Data Connectors Content Types

Creating the fields of content types from Data Connectors is done through the Fields endpoint.

Request:
    POST https://api.everlive.com/v1/Metadata/Applications/your-app-id/Types/type-id-here/Fields
Headers:
    Content-Type: application/json
    Authorization: Masterkey your-master-key-here
Body:
    [{
        "Name": "CustomerName",
        "Title" : "Customer Name",
        "SourceFieldName": "source-field-name-here",
        "IsReadOnly": false,
        "DataType": 1
    }, {
        "Name": "CustomerAddress",
        "Title" : "Customer Address",
        "SourceFieldName": "source-field-name-here",
        "IsReadOnly": false,
        "DataType": 1
    }]

Response:
    Status: 201 Created
    Content-Type: application/json
Body:
    {
        "Result":
        [{
            "Id": "42eec20b-ce8d-4e47-b1b0-14810fded5a9",
            "CreatedAt": "2014-04-28T08:16:36.312Z"
        }, {
            "Id": "68edc20b-cc8d-4e77-b1b0-14810fded5a3",
            "CreatedAt": "2014-04-28T08:16:36.312Z"

        }]
    }

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

Name Type Description
Name Text The name of the field that will appear in Telerik Platform. Cannot contain spaces.
Example: BackendFieldName
Title Text (Optional) A user-friendly name that appears in the portal.
Example: Backend Field Name
SourceFieldName Text The name of the source field (the column name for relational databases).
Example: CustomerName
IsReadOnly Boolean Specifies if the field should be available only for reading.
DataType Number Specifies the field type. See Supported Field Types for possible values.

You can find more information about IsReadOnly in Creating an SQL Data Connectors Content Type Using the Portal and Creating a Salesforce Data Connectors Content Type Using the Portal.

See Also


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