Method GetPositionData

Type: FusionOSServices.Controllers.HRPositionController

Summary

This service returns information about PCNs

Example

GET https://fusion.superion.com/FusionOSServices/v1/ONESolution/HumanResources/Positions/HOURS?fields=cdhno,cdhtitle,longdesc,pcn,cdhrelcd06+TCPType&cdhrelcd05=TCP&pcn=0105+like

Parameters

TypeDescription
System.String If a PCN number is supplied, only information for that postion will be returned

Sample Code

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

public void MethodName(parms){

    string uri = "https://fusion.superion.com/FusionOSServices/v1/ONESolution/HumanResources/Positions/HOURS?fields=cdhno,cdhtitle,longdesc,pcn,cdhrelcd06+TCPType&cdhrelcd05=TCP&pcn=0105+like";


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

            foreach (var item in items )
            {
                foreach (var hour in item["HOURS"])
                {
                // Your code goes here
                }
            }
            // responses with more then 1000 positions are broken up into multiple requests
            uri = (string)response["RequestResponse"]["NextUri"];
        }
    }
}

Sample Responses


                        
            {
              "RequestResponse": {
                "Count": "3",
                "DATA": {
                  "POSITION": [
                    {
                      "LONGDESC": "CITY COUNCIL",
                      "PCN": "01050000",
                      "HOURS": [
                        {}
                      ]
                    },
                    {
                      "LONGDESC": "CITY COUNCIL",
                      "PCN": "01050000",
                      "HOURS": [
                        {
                          "HOUR": [
                            {
                              "CDHNO": "3002",
                              "CDHTITLE": "SALARY",
                              "TCPTYPE": "REG"
                            },
                            {
                              "CDHNO": "3402",
                              "CDHTITLE": "VACATION USED",
                              "TCPTYPE": "LEAVE"
                            },
                            {
                              "CDHNO": "3422",
                              "CDHTITLE": "SICK USED",
                              "TCPTYPE": "LEAVE"
                            },
                            {
                              "CDHNO": "3432",
                              "CDHTITLE": "SICK USED-FAMILY",
                              "TCPTYPE": "LEAVE"
                            },
                            {
                              "CDHNO": "3442",
                              "CDHTITLE": "PERSONAL USED",
                              "TCPTYPE": "LEAVE"
                            },
                            {
                              "CDHNO": "3462",
                              "CDHTITLE": "ADMIN USED",
                              "TCPTYPE": "LEAVE"
                            },
                            {
                              "CDHNO": "3488",
                              "CDHTITLE": "COMP USED",
                              "TCPTYPE": "LEAVE"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "LONGDESC": "CITY COUNCIL",
                      "PCN": "01050000",
                      "HOURS": [
                        {
                          "HOUR": [
                            {
                              "CDHNO": "3002",
                              "CDHTITLE": "SALARY",
                              "TCPTYPE": "REG"
                            },
                            {
                              "CDHNO": "3402",
                              "CDHTITLE": "VACATION USED",
                              "TCPTYPE": "LEAVE"
                            },
                            {
                              "CDHNO": "3422",
                              "CDHTITLE": "SICK USED",
                              "TCPTYPE": "LEAVE"
                            },
                            {
                              "CDHNO": "3432",
                              "CDHTITLE": "SICK USED-FAMILY",
                              "TCPTYPE": "LEAVE"
                            },
                            {
                              "CDHNO": "3442",
                              "CDHTITLE": "PERSONAL USED",
                              "TCPTYPE": "LEAVE"
                            },
                            {
                              "CDHNO": "3462",
                              "CDHTITLE": "ADMIN USED",
                              "TCPTYPE": "LEAVE"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              }
            }
             
        

Remarks

Query string options SkipRows: The number of rows at the begining of the query to not report. TakeRows: The number of rows from the query to report. If left blank the default is 1000. ?TakeRows=10 results in only 10 rows being returned. ?SkipRows=10 results in all rows after row 10 being returned. ?SkipRows=10&TakeRows=10 results in rows 11 through 20 being returned. Fields: A list of table columns to be included in the query. If this is included in the query string then only the listed columns will be reported. (note that the examples below are for HREmpmstr, but similar ideas can be applied to any table) ?fields=fname,lname results in only the first and last name being reported. Columns can be renamed by appending the new name after the default name. ?fields=fname+FirstName,lname+LastName Filters: Any column name can be added to the query string as a filter. For example ?fname=Dan ?hdt=1/1/2017 By default the filter comparison is equality. Other comparison are available and can be appended to the filter "?fname=Dan+like " will select Dan, Daniel and Dannie "?hdt=1/1/2017+gt" will include all dates after 1/1/2017 Available comparisons are: "ge", greater than or equal to (>=) "gt", greater than (>) "isnotnull", is not null "isnull", is null "le", less than or equal to (<=) "like", like "lt", less than (<) "ne", not equal (!= , <>) "notlike", not like