Method TCPLeaveTransactions

Type: FusionOSServices.Controllers.TimeClockPlusController

Summary

This service returns the information about employee leave transactions

Example

GET https://fusion.superion.com/FusionOSServices/v0/ONESolution/TimeClockPlus/LeaveTransactions/2016-12-31/01050000

Parameters

TypeDescription
System.String If a date is provided, only leave transaction that occured on or after that date will be returned.
System.String If an employee ID is provided only information for that employee will be returned. If ID employee is provided, then a report date must be provided as well.

Sample Code

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

public void MethodName(parms){

    string uri = "https://fusion.superion.com/FusionOSServices/v0/ONESolution/TimeClockPlus/LeaveTransactions/2015-12-31";
    

    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 transactions = (JContainer)response["RequestResponse"]["DATA"]["Transaction"];

            foreach (var transaction in transactions )
            {
                // Your code goes here
                string leaveType = (string)transactions["LeaveType"];
                string transactionsDescription = (string)transactions["Description"];
                string transactionsEmployee = (string)transactions["IDA"];
                string transactionsHours = (string)transactions["Hours"];
                string transactionsDate = (string)transactions["TRNSDATE"];
            }
            // responses with more then 1000 positions are broken up into multiple requests
            uri = (string)response["RequestResponse"]["NextUri"];
        }
    }
}

Sample Responses


                        
             {
              "RequestResponse": {
                "Count": "3",
                "DATA": {
                  "Transaction": [
                    {
                      "LeaveType": "Sick Leave",
                      "Description": "SICK ACCRUAL",
                      "Hours": "8.00000",
                      "IDA": "E00011",
                      "TRNSDATE": "12/31/2016 12:00:00 AM"
                    },
                    {
                      "LeaveType": "Vacation",
                      "Description": "VACATION ACCRUAL",
                      "Hours": "17.33000",
                      "IDA": "E00011",
                      "TRNSDATE": "12/31/2016 12:00:00 AM"
                    },
                    {
                      "LeaveType": "Vacation",
                      "Description": "VACATION USED",
                      "Hours": "-8.00000",
                      "IDA": "E01010",
                      "TRNSDATE": "1/31/2017 12:00:00 AM"
                    }
                  ]
                }
              }
            }