Getting a Subset of Fields

Normally, when you read data stored on Telerik Platform, all item fields are returned by the server. However, you can choose to receive only a subset of all available fields for each item. This saves bandwidth and can improve your app performance.

Use the X-Everlive-Fields header to specify the fields. You have two options: either specify only the fields the you want returned or specify fields that you want to exclude from the default result. You cannot mix include and exclude specifications, the only exception being the Id field.

Including Items

You can request one or more fields to be returned, excluding all others. To do that, set the field names to 1 in the X-Everlive-Fields header.

Note that the Id field is always returned unless you explicitly set it to 0. This is the only exception where you can mix include and exclude specifications.

Request:
    GET https://api.everlive.com/v1/your-app-id/Books
Headers:
    Authorization  Bearer your-access-token
    X-Everlive-Fields  {
        "Title" : 1,
        "ISBN" : 1,
        "Id" : 0
    }

Response:
    Status: 200 OK
    Content-Type: application/json
var fieldsExp = { "Title" : 1, "ISBN" : 1, "Id" : 0 };

//Ajax request using jQuery
$.ajax({
    url: 'https://api.everlive.com/v1/your-app-id/Books',
    type: "GET",
    headers: {
        "Authorization" : "Bearer your-access-token",
        "X-Everlive-Fields" : JSON.stringify(fieldsExp)
    },
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
});

Excluding Items

If you want to return most of the item fields but a few, it is easier to specify the few than to list the majority. To do that, set the fields that you want to exclude to 0 in the X-Everlive-Fields header.

Request:
    GET https://api.everlive.com/v1/your-app-id/Books
Headers:
    Authorization  Bearer your-access-token
    X-Everlive-Fields  {
        "Author" : 0,
        "ISBN" : 0
    }

Response:
    Status: 200 OK
    Content-Type: application/json
var fieldsExp = {
    "Author" : 0,
    "ISBN" : 0
};

//Ajax request using jQuery
$.ajax({
    url: 'https://api.everlive.com/v1/your-app-id/Books',
    type: "GET",
    headers: {
        "Authorization" : "Bearer your-access-token",
        "X-Everlive-Fields" : JSON.stringify(fieldsExp)
    },
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
});

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.