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

Reading Roles

Reading Roles

As with data operations you can retrieve information about a single role as well as several or all roles using a single call. Requesting all roles returns an array of role objects.

Reading a Single Role

You need the role ID to read information about a role:

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

This request returns a single role object:

{
    "Result": {
        "Name": "Premium",
        "CreatedAt": "2015-07-06T11:19:04.385Z",
        "ModifiedAt": "2015-07-06T11:19:04.385Z",
        "Id": "cf5d8310-23d0-11e5-9c49-2740f827794e"
    }
}

Reading All Roles

The following request returns information about all roles in the application. Any filtering, sorting, or paging parameters can be passed to the request. See Introduction to Querying for details.

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

This request returns an array of role objects:

{
    "Count": 2,
    "Result": [
        {
            "Name": "Registered",
            "CreatedAt": "2015-05-11T09:33:22.776Z",
            "ModifiedAt": "2015-05-11T09:33:22.776Z",
            "Id": "c42a8560-f7c0-11e4-87db-713680c9d2da"
        },
        {
            "Name": "Premium",
            "CreatedAt": "2015-07-06T11:19:04.385Z",
            "ModifiedAt": "2015-07-06T11:19:04.385Z",
            "Id": "cf5d8310-23d0-11e5-9c49-2740f827794e"
        }
    ]
}

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.