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 Job Code Assignments in TSheets
Overview
The following operations allow you to work with job code assignments. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with job code assignments, see Sample configuration.
Operation | Description |
---|---|
Adding one or more job code assignments to a user. | |
listJobCodeAssignments | Retrieves a list of all job code assignments. |
Operation details
This section provides further details on the operations related to job code assignments.
Adding a job code assignment to a user
The addJobCodeAssignments
operation adds one or more job code assignments to a user.
<tsheets.addJobCodeAssignments> <jobCodeAssignments>{$ctx:jobCodeAssignments}</jobCodeAssignments> </tsheets.addJobCodeAssignments>
Properties
Job code assignment details. JSON object or array.jobCodeAssignments:
Sample request
Following is a sample REST/JSON request that can be handled by the addJobCodeAssignments
operation.
{ "apiUrl":"https://rest.tsheets.com", "accessToken":"S.1__730ab728db5db2f5a797363ce677ab3305f398da", "jobCodeAssignments":[ { "user_id":"1920492", "jobcode_id":"30676833" }, { "user_id":"1920502", "jobcode_id":"30676835" } ] }
Related TSheets documentation
http://developers.tsheets.com/docs/api/jobcode_assignments/add-jobcode-assignments
Retrieving a list of all job code assignments
The
operation retrieves a list of all job code assignments associated with users.listJobCodeAssignments
<tsheets.listJobCodeAssignments> <page>{$ctx:page}</page> <modifiedSince>{$ctx:modifiedSince}</modifiedSince> <modifiedBefore>{$ctx:modifiedBefore}</modifiedBefore> <userIds>{$ctx:userIds}</userIds> <active>{$ctx:active}</active> <perPage>{$ctx:perPage}</perPage> <jobcodeParentId>{$ctx:jobcodeParentId}</jobcodeParentId> <type>{$ctx:type}</type> </tsheets.listJobCodeAssignments>
Properties
Integer. Represents the page of results to retrieve.page:
String (ISO 8601 format). Only job code assignments modified since this date/time will be returned (i.e. 2004-02-12T15:19:21+00:00).modifiedSince:
String (ISO 8601 format). Only job code assignments modified before this date/time will be returned (i.e. 2004-02-12T15:19:21+00:00).modifiedBefore:
Integer. Comma separated string of one or more user IDs.userIds:
String. yes, no, or both. Default is both. Yes means the assignment is active, no means it is deleted/inactive.active:
Integer. Represents how many results to retrieve per request (page). Default is 50. Max is 50.perPage:
Integer. When omitted, all job code assignments are returned regardless of job code parent.jobcodeParentId:
String. Refers to the jobcode type - regular, pto, or all. Defaults to regular.type:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.listJobCodeAssignments
{ "apiUrl": "https://rest.tsheets.com", "accessToken": "S.1__730ab728db5db2f5a797363ce677ab3305f398da", "page":"1", "modifiedSince":"2015-02-26T12:04:21+00:00", "modifiedBefore":"2015-04-26T12:04:21+00:00", "userIds":"1920502", "active":"yes", "perPage":"5", "jobcodeParentId":"0", "type":"pto" }
Related TSheets documentation
http://developers.tsheets.com/docs/api/jobcode_assignments/list-jobcode-assignments
Sample configuration
Following is a sample proxy service that illustrates how to connect to TSheets with the init
operation and use the addJobCodeAssignments
operation. The sample request for this proxy can be found in the addJobCodeAssignments 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="tsheets_addJobCodeAssignments" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="accessToken" expression="json-eval($.accessToken)"/> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="jobCodeAssignments" expression="json-eval($.jobCodeAssignments)"/> <tsheets.init> <accessToken>{$ctx:accessToken}</accessToken> <apiUrl>{$ctx:apiUrl}</apiUrl> </tsheets.init> <tsheets.addJobCodeAssignments> <jobCodeAssignments>{$ctx:jobCodeAssignments}</jobCodeAssignments> </tsheets.addJobCodeAssignments> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>