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.
Operation | Description |
---|---|
Creates a new project timesheet | |
getProjectTimesheet | Retrieves project timesheet details |
updateProjectTimesheet | Updates project timesheet details |
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.
<peoplehr.createProjectTimesheet> <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
The start time of the timesheet. Input format "hh:mm".startTime:
The name of the project that the time sheet needs to be created for.timesheetProject:
The detail name that needs to be entered in the timesheet.timesheetDetail:
The date of the project timesheet.projectTimesheetDate:
The quantity of the timesheet.quantity:
The task name that needs to be entered in the timesheet.timesheetTask:
Any additional details about the timesheet.notes:
The total number of hours. It should match the start and end time.totalHours:
The end time of the timesheet. Input format "hh:mm".endTime:
Sample request
Following is a sample REST/JSON request that can be handled by the createProjectTimesheet
operation.
{ "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.
<peoplehr.getProjectTimesheet> <startDate>{$ctx:startDate}</startDate> <endDate>{$ctx:endDate}</endDate> </peoplehr.getProjectTimesheet>
Properties
The start date of the project timesheet.startDate:
The end date of the project timesheet.endDate:
Sample request
Following is a sample REST/JSON request that can be handled by the getProjectTimesheet operation.
{ "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.
<peoplehr.updateProjectTimesheet> <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
The start time of the timesheet. Input format "hh:mm".startTime:
The project name that the timesheet needs to be updated with.timesheetProject:
The ID of the transaction for creating the project timesheet.transactionId:
The detail name that needs to be updated in the timesheet.timesheetDetail:
The quantity of the timesheet.quantity:
The task name that needs to be updated in the timesheet.timesheetTask:
Any additional details about the timesheet.notes:
The total number of hours. It should match the start and end time.totalHours:
The end time of the timesheet. Input format "hh:mm".endTime:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.updateProjectTimesheet
Deleting a Project timesheet
The deleteProjectTimesheet
operation deletes an existing project timesheet.
<peoplehr.deleteProjectTimesheet> <transactionId>{$ctx:transactionId}</transactionId> </peoplehr.deleteProjectTimesheet>
Properties
The transaction ID of the timesheet.transactionId:Required -
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.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.
<?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> <employeeId>{$ctx:employeeId}</employeeId> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiKey>{$ctx:apiKey}</apiKey> </peoplehr.init> <peoplehr.createProjectTimesheet> <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>