List All Roles

Returns a list of your all Roles in your TimeLive account.

GET /API/Employees/GetActiveRoles

Example Request

using System;
namespace TimeLiveAPISample
{
    class Program
    {
        static void Main(string[] args)
        {
            const string URL = "http://demo.livetecs.com/api/employees/getactiveroles";
            try
            {
                var webRequest = System.Net.WebRequest.CreateHttp(URL);
                if (webRequest != null)
                {
                    webRequest.Method = "GET";
                    webRequest.UserAgent = "C# TimeLive API Sample";
                    webRequest.Headers.Add("AuthToken", <TIMELIVE_AUTHENTICATION_TOKEN>);
                    webRequest.Headers.Add("APIKey", <TIMELIVE_API_KEY>);
                    using (System.IO.Stream s = webRequest.GetResponse().GetResponseStream())
                    {
                        using (System.IO.StreamReader sr = new System.IO.StreamReader(s))
                        {
                            var jsonResponse = sr.ReadToEnd();
                            Console.WriteLine(jsonResponse);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }            
        }
    }
}

Example Response

[
  {
    "AccountRoleId": 207,
    "AccountId": 151,
    "Role": "Administrator",
    "IsDisabled": false,
    "IsDeleted": false,
    "CreatedOn": "2007-02-03T16:39:42.45+00:00",
    "CreatedByEmployeeId": 0,
    "ModifiedOn": "2007-02-03T16:39:42.45+00:00",
    "ModifiedByEmployeeId": 0,
    "MasterAccountRoleId": 1,
    "IsSystemRole": null
  },
  {
    "AccountRoleId": 208,
    "AccountId": 151,
    "Role": "User",
    "IsDisabled": false,
    "IsDeleted": false,
    "CreatedOn": "2007-02-03T16:39:42.45+00:00",
    "CreatedByEmployeeId": 0,
    "ModifiedOn": "2007-02-03T16:39:42.45+00:00",
    "ModifiedByEmployeeId": 0,
    "MasterAccountRoleId": 2,
    "IsSystemRole": null
  }
]