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

Reading Data Items

Reading Data Items

Using a single Backend Services RESTful API call you can read a single item, all items in a content type, or a filtered result set.

Reading a Single Item by ID

You need to know the item's ID to read it. Then include it in the request URL right after the content type name.

Request:
    GET https://api.everlive.com/v1/your-app-id/type-name/item-id
Header:
    Authorization Bearer your-access-token

Response:
    Status: 200 OK
Content-Type:
    application/json
Body:
    {
        "Result": {
            "Text": "Sample value",
            "CreatedAt": "2016-01-12T07:42:00.653Z",
            "ModifiedAt": "2016-01-12T07:42:00.653Z",
            "CreatedBy": "00000000-0000-0000-0000-000000000000",
            "ModifiedBy": "00000000-0000-0000-0000-000000000000",
            "Owner": "00000000-0000-0000-0000-000000000000",
            "Id": "f71a37d0-b8ff-11e5-981b-99782870ba17"
        }
    }
//Ajax request using jQuery
$.ajax({
    url: 'https://api.everlive.com/v1/your-app-id/type-name/item-id',
    type: "GET",
    headers: {
        "Authorization" : "Bearer your-access-token"
    },
    success: function(data){
        alert(JSON.stringify(data));
    },
    error: function(error){
        alert(JSON.stringify(error));
    }
})

Reading Multiple Items

If you make a simple GET request to a content type's endpoint you get all its items as the next example shows. To limit the results, include a filtering or fields expression as described in Filtering and Getting a Subset of Fields. You can also modify the request to get sorted or paged results.

Multiple items are returned as an array.

Request:
    GET https://api.everlive.com/v1/your-app-id/type-name
Header:
    Authorization Bearer your-access-token

Response:
    Status: 200 OK
Content-Type:
    application/json
Body:
    {
        "Count": 5,
        "Result": [
            {
                "Text": "It is finally time for graduation! Good job everyone, we made it.",
                "UserId": "c473ea75-f7c0-11e4-87db-713680c9d2da",
                "CreatedBy": "c473ea75-f7c0-11e4-87db-713680c9d2da",
                "Owner": "c473ea75-f7c0-11e4-87db-713680c9d2da",
                "Picture": "c473ea74-f7c0-11e4-87db-713680c9d2da",
                "Likes": [
                    "c473ea73-f7c0-11e4-87db-713680c9d2da"
                ],
                "CreatedAt": "2015-05-11T09:33:25.068Z",
                "ModifiedAt": "2015-05-11T09:33:25.068Z",
                "ModifiedBy": "00000000-0000-0000-0000-000000000000",
                "Id": "c473ea77-f7c0-11e4-87db-713680c9d2da"
            },
            {
                "Text": "The most amazing sunset I have ever seen at Phuket, Thailand",
                "UserId": "c473ea73-f7c0-11e4-87db-713680c9d2da",
                "CreatedBy": "c473ea73-f7c0-11e4-87db-713680c9d2da",
                "Owner": "c473ea73-f7c0-11e4-87db-713680c9d2da",
                "Picture": "c473ea72-f7c0-11e4-87db-713680c9d2da",
                "CreatedAt": "2015-05-11T09:33:25.068Z",
                "ModifiedAt": "2015-05-11T09:33:25.068Z",
                "ModifiedBy": "00000000-0000-0000-0000-000000000000",
                "Id": "c473ea78-f7c0-11e4-87db-713680c9d2da"
            },
            //...
            //items skipped for brevity
            //...
            {
                "Text": "Sample value 2",
                "CreatedAt": "2016-01-12T07:42:00.654Z",
                "ModifiedAt": "2016-01-12T07:42:00.654Z",
                "CreatedBy": "00000000-0000-0000-0000-000000000000",
                "ModifiedBy": "00000000-0000-0000-0000-000000000000",
                "Owner": "00000000-0000-0000-0000-000000000000",
                "Id": "f71a5ee0-b8ff-11e5-981b-99782870ba17"
            }
        ]
    }
//Ajax request using jQuery
$.ajax({
    url: 'https://api.everlive.com/v1/your-app-id/type-name',
    type: "GET",
    headers: {
        "Authorization" : "Bearer your-access-token"
    },
    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.