Method ITGetTimecards

Type: FusionOSServices.Controllers.IntelliTimeController

Summary

This service returns timecard records that have created with this API. This can be run for all employees or for a single employee. In addition to the information inserted when the record was created, the date and time of the insertion will be returned.

Example

GET https://fusion.superion.com/FusionOSServices/v0/ONESolution/IntelliTime/Timecards

Sample Code

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

public void MethodName(parms){

    string uri = "https://fusion.superion.com/FusionOSServices/v0/ONESolution/IntelliTime/Timecards";

	// append an employee id if desired.
    uri += "/E00001"

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

            foreach (var timecard in timecards )
            {
                // Your code goes here
                string empId = (string)timecard["EMPID"];
                string hours = (string)timecard["HRS"];

            }
            // responses with more then 1000 positions are broken up into multiple requests
            uri = (string)response["RequestResponse"]["NextUri"];
        }
    }
}

Sample Responses


                        
              {
              "RequestResponse": {
                "Count": "2",
                "DATA": {
            		"INTERFACETIMECARDS":  [
            	   { "EMPID": "E0001",
            	     "HRS": "6.00000",
            	     "CDH": "3001",
            	     "TRANDT": "5/23/2017 4:24:58 PM",
            		 "CREATEWHEN": "5/25/2017 8:36:02 AM"
            	   },
            	   { "EMPID": "E0002",
            	     "HRS": "1.00000",
            	     "CDH": "3050",
            	     "TRANDT": "5/23/2017 4:24:58 PM"
            		 "CREATEWHEN": "5/25/2017 8:36:02 AM"
            	   }
            	   
            	}
              } 
            }