Reading Fields

Using the Administration API you can read the fields structure of a content type.

Read All Fields in a Content Type

To get all the fields of a content type see the following code snippet:

//Ajax request using jQuery
$.ajax({
    url: 'https://api.everlive.com/v1/Metadata/Applications/your-app-id/Types/type-id/Fields',
    type: "GET",
    headers: {"Authorization" : "Masterkey your-master-key"},
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
})
Request:
    GET https://api.everlive.com/v1/Metadata/Applications/your-app-id/Types/type-id/Fields
Headers:
    Authorization  Masterkey your-master-key
Response:
    Status: 200 OK
    Content-Type: application/json

Read Fields by Filter

By including the X-Everlive-Filter header in the request you can filter the fields.

var filter = { "FieldType" : 1 };

//Ajax request using jQuery
$.ajax({
    url: 'https://api.everlive.com/v1/Metadata/Applications/your-app-id/Types/type-id/Fields',
    type: "GET",
    headers: {
        "Authorization" : "Masterkey your-master-key",
        "X-Everlive-Filter": JSON.stringify(filter)
    },
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
})
Request:
    GET https://api.everlive.com/v1/Metadata/Applications/your-app-id/Types/type-id/Fields
Headers:
    Authorization  Masterkey your-master-key
    X-Everlive-Filter { "FieldType" : 1 }
Response:
    Status: 200 OK
    Content-Type: application/json

Read a Field by ID

To get the info about a content type field by id use the following code:

//Ajax request using jQuery
$.ajax({
    url: 'https://api.everlive.com/v1/Metadata/Applications/your-app-id/Types/type-id/Fields/field-id',
    type: "GET",
    headers: {"Authorization" : "Masterkey your-master-key"},
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
})
Request:
    GET https://api.everlive.com/v1/Metadata/Applications/your-app-id/Types/type-id/Fields/field-id
Headers:
    Authorization  Masterkey your-master-key
Response:
    Status: 200 OK
    Content-Type: application/json

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.