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

Paging

Telerik Platform can return query results in pages to save you bandwidth and additional operations on the client. A page is defined by a starting item (the one immediately preceding the first item on the page) specified using the X-Everlive-Skip header and the number of items it contains (the X-Everlive-Take header).

Paging is supported for READ and DELETE operations only.

The following example instructs the server to skip three items and return the next ten items. This means that it will return items 4 to 13 (if the first element is indexed 1). Most of the time you will want the items sorted in a particular order before reading them in pages, which is why the example adds sorting by the Author field. Sorting is always executed before paging.

Request:
    GET https://api.everlive.com/v1/your-app-id/Books
Headers:
    Authorization  Bearer your-access-token
    X-Everlive-Skip 3
    X-Everlive-Take 10
    X-Everlive-Sort { "Author" : 1 }

Response:
    Status: 200 OK
    Content-Type: application/json
var sortExp = { "Author" : 1 };

//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-Skip" : 3,
            "X-Everlive-Take" : 10,
            "X-Everlive-Sort" : JSON.stringify(sortExp)
    },
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
});

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.