API data extract from Kronos Workforce Central - using API Query component

Hi Team,

Im trying to use the API query component for extract data from Kronos Workforce Central API.

The structure of the WFC API call is slightly different, it only uses POST method (even for retrieving data), and no headers or parameters, everything is inside the BODY of the API call.

Example looks as follows:

 

<Kronos_WFC version='1.0'>

<Request Object="System" Action="Logon" Username="..." Password="..." />

 

    <Request Action='Load'>

        <Timesheet>

            <Employee>

                <PersonIdentity PersonNumber = '12345'/>

             </Employee>

             <Period>

                 <TimeFramePeriod PeriodDateSpan = '1/2/2023 - 28/2/2023' />

             </Period>

         </Timesheet>

     </Request>

 

<Request Object="System" Action="Logoff" />

</Kronos_WFC>

 

You logon, you request your data using specific tag (Timesheet), then you logoff. There is no authentication, everything is inside the BODY of the API call.

 

When im creating a NEW ENDPOINT in Matillion using the API Query wizard, it all works and returns expected response. But the JSON, which gets generated by the wizard doesnt contain any columns as i would expect, something like this:

 <api:info title="API_Config_Timesheet_Endpoint" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">

  <!-- You can modify the name, type, and column size here. -->

     <attr name="Total" xs:type="string" readonly="false" other:xPath="/DateTotals/Date" /> ----- this row or similar is not generated by the wizard

 </api:info>

 

My second problem is that the JSON uses GET method

 <api:script method="GET">

If i try to change it to POST, it just doesnt like it at all:

"Exception querying tables. Invalid method post found in the script."

 

All in all, im not getting any data from the calls.

Any ideas or tips for Kronos API, or an API call which contains only its BODY, please?

 

Thanks

George

Hi George,

I recently worked on a POST type API Query. We found we had to comment out a line near the end of the script. This line:

 <api:set attr="method" value="GET"/>

 

So the end of our script looked like this:

  <api:set attr="ContentType" value="application/json" />

  <!-- <api:set attr="method" value="GET"/> -->

  <api:call op="jsonproviderGet">

   <api:push/>

  </api:call>

 </api:script>

 

 

 

 

</api:script>

 

So that's something quick for you to try.