This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Project Timesheets in PeopleHR



Overview

The following operations allow you to work with project timesheets. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with project timesheets, see Sample configuration

OperationDescription

createProjectTimesheet

Creates a new project timesheet

getProjectTimesheetRetrieves project timesheet details
updateProjectTimesheetUpdates project timesheet details

deleteProjectTimesheet

Deletes a Project timesheet

Operation details

This section provides further details on the operations related to project timesheets.

Creating a project timesheet

The createProjectTimesheet operation creates a new project timesheet.

createProjectTimesheet
<peoplehr.createProjectTimesheet>
    <employeeId>{$ctx:employeeId}</employeeId>
    <startTime>{$ctx:startTime}</startTime>
    <timesheetProject>{$ctx:timesheetProject}</timesheetProject>
    <timesheetDetail>{$ctx:timesheetDetail}</timesheetDetail>
    <projectTimesheetDate>{$ctx:projectTimesheetDate}</projectTimesheetDate>
    <quantity>{$ctx:quantity}</quantity>
    <timesheetTask>{$ctx:timesheetTask}</timesheetTask>
    <notes>{$ctx:notes}</notes>
    <totalHours>{$ctx:totalHours}</totalHours>
	<endTime>{$ctx:endTime}</endTime>
</peoplehr.createProjectTimesheet>
Properties
  • employeeId: Refers to the ID of the employee.
  • startTime: The start time of the timesheet. Input format "hh:mm".
  • timesheetProject: The name of the project that the time sheet needs to be created for.
  • timesheetDetail: The detail name that needs to be entered in the timesheet.
  • projectTimesheetDate: The date of the project timesheet.
  • quantity: The quantity of the timesheet.
  • timesheetTask: The task name that needs to be entered in the timesheet.
  • notes: Any additional details about the timesheet.
  • totalHours: The total number of hours. It should match the start and end time.
  • endTime: The end time of the timesheet. Input format "hh:mm".
Sample request

Following is a sample REST/JSON request that can be handled by the createProjectTimesheet operation.

Sample Request for createProjectTimesheet
{
    "apiUrl": "https://api.peoplehr.net",
    "apiKey": "c85c2570-0602-xxxxxxxxxx",
    "employeeId": "PW555555",
    "projectTimesheetDate":"2014-09-04",
    "timesheetProject":"wso2ConnectorProject",
    "timesheetTask":"peopleHRDev",
    "timesheetDetail":"ConnectorDevelopment",
    "startTime":"09:00",
    "endTime":"12:00",
    "totalHours":"3",
    "quantity":"100",
    "notes":"Creating project timesheet for the day."
}

Retrieving a project timesheet 

The getProjectTimesheet operation retrieves project timesheet details.

getProjectTimesheet
 <peoplehr.getProjectTimesheet>
    <employeeId>{$ctx:employeeId}</employeeId>
    <startDate>{$ctx:startDate}</startDate>
	<endDate>{$ctx:endDate}</endDate>
</peoplehr.getProjectTimesheet>
Properties
  • employeeId: Refers to the ID of the employee.
  • startDate: The start date of the project timesheet.
  • endDate: The end date of the project timesheet.
Sample request

Following is a sample REST/JSON request that can be handled by the getProjectTimesheet operation.

Sample Request for getProjectTimesheet
{
    "apiUrl": "https://api.peoplehr.net",
    "apiKey": "c85c2570-0602-xxxxxxxxxx",
    "employeeId": "PW555555",
    "startDate": "2014-09-04",
    "endDate": "2014-12-30"
}

Updating a project timesheet

The updateProjectTimesheet operation updates an existing project timesheet.

updateProjectTimesheet
<peoplehr.updateProjectTimesheet>
    <employeeId>{$ctx:employeeId}</employeeId>
    <startTime>{$ctx:startTime}</startTime>
    <timesheetProject>{$ctx:timesheetProject}</timesheetProject>
    <transactionId>{$ctx:transactionId}</transactionId>
    <timesheetDetail>{$ctx:timesheetDetail}</timesheetDetail>
    <quantity>{$ctx:quantity}</quantity>
    <timesheetTask>{$ctx:timesheetTask}</timesheetTask>
    <notes>{$ctx:notes}</notes>
    <totalHours>{$ctx:totalHours}</totalHours>
	<endTime>{$ctx:endTime}</endTime>
</peoplehr.updateProjectTimesheet>
Properties
  • employeeId: Refers to the ID of the employee.
  • startTime: The start time of the timesheet. Input format "hh:mm".
  • timesheetProject: The project name that the timesheet needs to be updated with.
  • transactionId: The ID of the transaction for creating the project timesheet.
  • timesheetDetail: The detail name that needs to be updated in the timesheet.
  • quantity: The quantity of the timesheet.
  • timesheetTask: The task name that needs to be updated in the timesheet.
  • notes: Any additional details about the timesheet.
  • totalHours: The total number of hours. It should match the start and end time.
  • endTime: The end time of the timesheet. Input format "hh:mm".
Sample request

Following is a sample REST/JSON request that can be handled by the updateProjectTimesheet operation.

Sample Request for updateProjectTimesheet
{
    "apiUrl": "https://api.peoplehr.net",
    "apiKey": "c85c2570-0602-xxxxxxxxxx",
    "employeeId": "PW555555",
    "transactionId":"26571",
    "timesheetProject":"wso2ConnectorProject",
    "timesheetTask":"peopleHRDev",
    "timesheetDetail":"ConnectorDevelopment",
    "startTime":"08:00",
    "endTime":"14:00",
    "totalHours":"6",
    "quantity":"100",
    "notes":"Creating project timesheet for the daily."
}

Deleting a Project timesheet

 The deleteProjectTimesheet operation deletes an existing project timesheet.

deleteProjectTimesheet
<peoplehr.deleteProjectTimesheet>
    <employeeId>{$ctx:employeeId}</employeeId>
    <transactionId>{$ctx:transactionId}</transactionId>
</peoplehr.deleteProjectTimesheet>
Properties
  • employeeId:Required -Refers to the ID of the employee.
  • transactionId:Required -The transaction ID of the timesheet.

Sample request

Following is a sample REST/JSON request that can be handled by the deleteProjectTimesheet operation.

Sample Request for deleteProjectTimesheet
{
    "apiUrl":"https://api.peoplehr.net",
    "apiKey":"f6eeba00-e7c8-xxxxxxxxxx",
    "employeeId":"pw2",
    "transactionId":"667902"
}

Sample configuration

Following is a sample proxy service that illustrates how to connect to PeopleHR with the init operation and use the createProjectTimesheet operation. The sample request for this proxy can be found in createProjectTimesheet sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="peoplehr_createProjectTimesheet"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence onError="faultHandlerSeq">
         <property name="employeeId" expression="json-eval($.employeeId)"/>
         <property name="apiUrl" expression="json-eval($.apiUrl)"/>
         <property name="apiKey" expression="json-eval($.apiKey)"/>
         <property name="startTime" expression="json-eval($.startTime)"/>
         <property name="timesheetProject" expression="json-eval($.timesheetProject)"/>
         <property name="timesheetDetail" expression="json-eval($.timesheetDetail)"/>
         <property name="projectTimesheetDate"
                   expression="json-eval($.projectTimesheetDate)"/>
         <property name="quantity" expression="json-eval($.quantity)"/>
         <property name="timesheetTask" expression="json-eval($.timesheetTask)"/>
         <property name="notes" expression="json-eval($.notes)"/>
         <property name="totalHours" expression="json-eval($.totalHours)"/>
         <property name="endTime" expression="json-eval($.endTime)"/>
         <peoplehr.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <apiKey>{$ctx:apiKey}</apiKey>
         </peoplehr.init>
         <peoplehr.createProjectTimesheet>
            <employeeId>{$ctx:employeeId}</employeeId>
            <startTime>{$ctx:startTime}</startTime>
            <timesheetProject>{$ctx:timesheetProject}</timesheetProject>
            <timesheetDetail>{$ctx:timesheetDetail}</timesheetDetail>
            <projectTimesheetDate>{$ctx:projectTimesheetDate}</projectTimesheetDate>
            <quantity>{$ctx:quantity}</quantity>
            <timesheetTask>{$ctx:timesheetTask}</timesheetTask>
            <notes>{$ctx:notes}</notes>
            <totalHours>{$ctx:totalHours}</totalHours>
            <endTime>{$ctx:endTime}</endTime>
         </peoplehr.createProjectTimesheet>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>