Method TCPPutTimecards

Type: FusionOSServices.Controllers.TimeClockPlusController

Summary

This service writes time card info to ONESolution.

Example

PUT https://fusion.superion.com/FusionOSServices/v0/ONESolution/TimeClockPlus/Timecards

Sample Code

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

public void MethodName(parms){

    string uri = "https://fusion.superion.com/FusionOSServices/v0/ONESolution/TimeClockPlus/Timecards";
    string data = "[" +
                  "  {" +
                  " \"EmpId\": \"E00011\", " +
                  " \"TranDt\" : \"3/29/2017\", " +
                  " \"RecType\" : \"S0\", " +
                  " \"Hrs\": 4," +
                  " \"Cdh\" : \"3001\", " +
                  "  } " +
                  " , " +
                  "  { " +
                  "  \"EmpId\": \"E00011\", " +
                  "  \"TranDt\" : \"3/15/2017\", " +
                  "  \"RecType\" : \"PM\", " +
                  "  \"Hrs\": 4.00000,  " +
                  "  \"Cdh\" : \"3001\", " +
                  "  } " +
                  "  ]";

    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");

        string result = wc.UploadString(uri, "PUT", data);

        var response = JObject.Parse(result);
        var count = (string)response["RequestResponse"]["Count"];
        
        // verify count is expected number
        }
    }
}

Sample Responses


                        
             {
              "RequestResponse": {
                "Count": "2",
                "DATA": null
              }
            }