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 Tasks in FreeAgent
Overview
The following operations allow you to work with tasks. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with tasks, see Sample configuration.
Operation | Description |
---|---|
Creates a new task. | |
getTaskById | Retrieves a single task by ID. |
listTasks | Retrieves all tasks. |
Operation details
This section provides further details on the operations related to tasks.
Creating a new task
The createTask
operation creates a new task.
<freeagent.createTask> <project>{$ctx:project}</project> <billingPeriod>{$ctx:billingPeriod}</billingPeriod> <status>{$ctx:status}</status> <isBillable>{$ctx:isBillable}</isBillable> <name>{$ctx:name}</name> <billingRate>{$ctx:billingRate}</billingRate> </freeagent.createTask>
Properties
The project to which the task belongs.project:
The billing period of the task.billingPeriod:
The status of the task.status:
Whether the task is billable.isBillable:
The name of the task.name:
The billing rate of the task.billingRate:
Sample request
Following is a sample REST/JSON request that can be handled by the createTask
operation.
{ "accessToken":"1S1Sd_eb-pE0hjMJnWrYmj4vfi496Gf0YyRhzzgRE", "apiUrl":"https://api.sandbox.freeagent.com", "project":"2731", "name":"UpdateInventory", "billingPeriod":"hour", "status":"active", "isBillable":"true", "billingRate":"12.0" }
Related FreeAgent documentation
https://dev.freeagent.com/docs/tasks#create-a-task-under-a-certain-project
Retrieving a single task by ID
The
operation retrieves a single task by ID.getTaskById
<freeagent.getTaskById> <id>{$ctx:id}</id> </freeagent.getTaskById>
Properties
The ID of the task.id:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.getTaskById
{ "accessToken":"1S1Sd_eb-pE0hjMJnWrYmj4vfi496Gf0YyRhzzgRE", "apiUrl":"https://api.sandbox.freeagent.com", "id":"315" }
Related FreeAgent documentation
https://dev.freeagent.com/docs/tasks#get-a-single-task
Retrieving all tasks
The
operation retrieves all tasks.listTasks
<freeagent.listTasks> <project>{$ctx:project}</project> </freeagent.listTasks>
Properties
The ID of the project for which tasks will be retrieved.project:
Sample request
Following is a sample REST/JSON request that can be handled by the
operation.listTasks
{ "accessToken":"1S1Sd_eb-pE0hjMJnWrYmj4vfi496Gf0YyRhzzgRE", "apiUrl":"https://api.sandbox.freeagent.com", "project":"2731" }
Related FreeAgent documentation
https://dev.freeagent.com/docs/tasks#list-all-tasks-under-a-certain-project
Sample configuration
Following is a sample proxy service that illustrates how to connect to FreeAgent with the init
operation and use the createTask
operation. The sample request for this proxy can be found in the createTask 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_createTask" 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="project" expression="json-eval($.project)"/> <property name="billingPeriod" expression="json-eval($.billingPeriod)"/> <property name="status" expression="json-eval($.status)"/> <property name="isBillable" expression="json-eval($.isBillable)"/> <property name="name" expression="json-eval($.name)"/> <property name="billingRate" expression="json-eval($.billingRate)"/> <freeagent.init> <accessToken>{$ctx:accessToken}</accessToken> <apiUrl>{$ctx:apiUrl}</apiUrl> </freeagent.init> <freeagent.createTask> <project>{$ctx:project}</project> <billingPeriod>{$ctx:billingPeriod}</billingPeriod> <status>{$ctx:status}</status> <isBillable>{$ctx:isBillable}</isBillable> <name>{$ctx:name}</name> <billingRate>{$ctx:billingRate}</billingRate> </freeagent.createTask> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>