Method GetEmployeeBenefits

Type: FusionOSServices.Controllers.BenTekController

Summary

This service returns the following information about employees: employee ID, benefet plan, benefet plan begin date and benefit plan end date.

Example

GET https://localhost/FusionOSServices:44398/v1/ONESolution/BenTek/Employees/Benefits/E01010

Parameters

TypeDescription
System.String If an employee ID is provided only information for that employee will be returned.

Sample Code

using System.Net;
using Newtonsoft.Json.Linq;

public void MethodName(parms){

    string uri = "https://localhost:44398/v1/ONESolution/BenTek/Employees/Benefits/E01010";
    

    using (WebClient wc = new WebClient())
    {
        wc.Headers.Add("Content-Type", "application/json");
        // Replace "ID" with supplied AppID
        wc.Headers.Set("X-APPID", "ID");
        // Replace "KEY" with supplied AppKey
        wc.Headers.Set("X-APPKEY", "KEY");

        while (uri != null)
        {
            string result = wc.DownloadString(uri);

            var response = JObject.Parse(result);

            var count = (string)response["RequestResponse"]["Count"];
            var benefits = (JContainer)response["RequestResponse"]["DATA"]["HRBENEINFOS"];

            foreach (var benefit in benefits)
            {
                string empId = (string)member["IDA"];
                
                // Your code goes here
            }
            // responses with more then 1000 benefit records are broken up into multiple requests
            uri = (string)response["RequestResponse"]["NextUri"];
        }
    }
}

Sample Responses


                        
            {
            "RequestResponse": {
            "Count": "5",
            "DATA": {
            "HRBENEINFOS": [
            {
            "BENEBEG": "7/1/2009 12:00:00 AM",
            "BENEEND": "12/31/2050 12:00:00 AM",
            "BENEPLAN": "BLPDPT00",
            "IDA": "E01010"
            },
            {
            "BENEBEG": "12/14/2013 12:00:00 AM",
            "BENEEND": "12/31/2050 12:00:00 AM",
            "BENEPLAN": "SLSPATSP",
            "IDA": "E01010"
            },
            {
            "BENEBEG": "1/1/2016 12:00:00 AM",
            "BENEEND": "12/22/2016 12:00:00 AM",
            "BENEPLAN": "ADBPATE0",
            "IDA": "E01010"
            },
            {
            "BENEBEG": "12/23/2016 12:00:00 AM",
            "BENEEND": "12/31/2050 12:00:00 AM",
            "BENEPLAN": "ADBPATE0",
            "IDA": "E01010"
            },
            {
            "BENEBEG": "7/7/2017 12:00:00 AM",
            "BENEEND": "12/31/2050 12:00:00 AM",
            "BENEPLAN": "BNSWPTE0",
            "IDA": "E01010"
            }
            ]
            }
            }
            }