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 Time Slips in FreeAgent
Overview
The following operations allow you to work with time slips. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with time slips, see Sample configuration.
Operation | Description |
---|---|
Creates a new time slip. | |
getTimeSlipById | Retrieves a single time slip by ID. |
listTimeSlips | Retrieves all time slips. |
Operation details
This section provides further details on the operations related to time slips.
Creating a new time slip
The createTimeSlip
operation creates a new time slip.
<freeagent.createTimeSlip> <datedOn>{$ctx:datedOn}</datedOn> <project>{$ctx:project}</project> <hours>{$ctx:hours}</hours> <task>{$ctx:task}</task> <comment>{$ctx:comment}</comment> <user>{$ctx:user}</user> </freeagent.createTimeSlip>
Properties
The date mentioned for the time slip.datedOn:
The ID of the project to which the time slip belongs.project:
The number of hours of the time slip.hours:
The ID of the task to which the time slip belongs.task:
Comments relevant to the time slip.comment:
The ID of the user to which the time slip belongs.user:
Sample request
Following is a sample REST/JSON request that can be handled by the createTimeSlip
operation.
{ "apiUrl": "https://api.sandbox.freeagent.com", "accessToken": "1S1Sd_eb-pE0hjMJnWrYmj4vfi496Gf0YyRhzzgRE", "datedOn":"2015-01-10", "project":"2731", "hours":"10", "task":"316", "comment":"", "user":"827" }
Related FreeAgent documentation
https://dev.freeagent.com/docs/timeslips#create-a-timeslip
Retrieving a single time slip by ID
The
operation retrieves a single time slip by ID.getTimeSlipById
<freeagent.getTimeSlipById> <id>{$ctx:id}</id> </freeagent.getTimeSlipById>
Properties
The ID of the time slip.id:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.getTimeSlipById
{ "apiUrl": "https://api.sandbox.freeagent.com", "accessToken": "1S1Sd_eb-pE0hjMJnWrYmj4vfi496Gf0YyRhzzgRE", "id": "3126" }
Related FreeAgent documentation
https://dev.freeagent.com/docs/timeslips#get-a-single-timeslip
Retrieving all time slips
The
operation retrieves all time slips.listTimeSlips
<freeagent.listTimeSlips> <project>{$ctx:project}</project> <fromDate>{$ctx:fromDate}</fromDate> <task>{$ctx:task}</task> <toDate>{$ctx:toDate}</toDate> <user>{$ctx:user}</user> </freeagent.listTimeSlips>
Properties
The ID of the project to which the time slip belongs.project:
The starting date of the time slip.fromDate:
The ID of the task to which the time slip belongs.task:
The end date of the time slip.toDate:
The ID of the user to which the time slip belongs.user:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.listTimeSlips
{ "apiUrl": "https://api.sandbox.freeagent.com", "accessToken": "1S1Sd_eb-pE0hjMJnWrYmj4vfi496Gf0YyRhzzgRE", "fromDate":"2014-01-31", "toDate":"2015-02-02", "user":"827", "project":"2732", "task":"342" }
Related FreeAgent documentation
https://dev.freeagent.com/docs/timeslips#list-all-timeslips
Sample configuration
Following is a sample proxy service that illustrates how to connect to FreeAgent with the init
operation and use the createTimeSlip
operation. The sample request for this proxy can be found in the createTimeSlip 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="freeagent_createTimeSlip" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <property name="accessToken" expression="json-eval($.accessToken)"/> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="datedOn" expression="json-eval($.datedOn)"/> <property name="project" expression="json-eval($.project)"/> <property name="hours" expression="json-eval($.hours)"/> <property name="task" expression="json-eval($.task)"/> <property name="comment" expression="json-eval($.comment)"/> <property name="user" expression="json-eval($.user)"/> <freeagent.init> <accessToken>{$ctx:accessToken}</accessToken> <apiUrl>{$ctx:apiUrl}</apiUrl> </freeagent.init> <freeagent.createTimeSlip> <datedOn>{$ctx:datedOn}</datedOn> <project>{$ctx:project}</project> <hours>{$ctx:hours}</hours> <task>{$ctx:task}</task> <comment>{$ctx:comment}</comment> <user>{$ctx:user}</user> </freeagent.createTimeSlip> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>