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

OperationDescription

createTimeSlip

Creates a new time slip.

getTimeSlipByIdRetrieves a single time slip by ID.
listTimeSlipsRetrieves 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.

createTimeSlip
<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
  • datedOn: The date mentioned for the time slip.
  • project: The ID of the project to which the time slip belongs.
  • hours: The number of hours of the time slip.
  • task: The ID of the task to which the time slip belongs.
  • comment: Comments relevant to the time slip.
  • user: The ID of the user to which the time slip belongs.
Sample request

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

Sample Request for createTimeSlip
{
	"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 getTimeSlipById operation retrieves a single time slip by ID.

getTimeSlipById
<freeagent.getTimeSlipById>
	<id>{$ctx:id}</id>
</freeagent.getTimeSlipById>
Properties
  • id: The ID of the time slip.
Sample request

Following is a sample REST/JSON request that can be handled by the getTimeSlipById 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 listTimeSlips 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
  • project: The ID of the project to which the time slip belongs.
  • fromDate: The starting date of the time slip.
  • task: The ID of the task to which the time slip belongs.
  • toDate: The end date of the time slip.
  • user: The ID of the user to which the time slip belongs.
Sample request

Following is a sample REST/JSON request that can be handled by the listTimeSlips 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.

Sample Proxy
<?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>