Working with Projects in FreshBooks

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 Projects in FreshBooks

The createProject operation creates a new project. 

createProject
<freshbooks.createProject>
    <projectName>{$ctx:projectName}</projectName>
    <billMethod>{$ctx:billMethod}</billMethod>
    <clientId>{$ctx:clientId}</clientId>
    <rate>{$ctx:rate}</rate>
    <description>{$ctx:description}</description>
    <hourBudget>{$ctx:hourBudget}</hourBudget>
	<tasks>{$ctx:tasks}</tasks>
</freshbooks.createProject> 
Properties
  • projectName: The name of the project.
  • billMethod: The method of billing for the project.
  • clientId: The ID of the client of the project.
  • rate: Billing rate for the project.
  • description: Detailed description of the project.
  • hourBudget: Hourly budget for the project.
  • tasks: Tasks associated with the project.
Sample request

Following is a sample REST/XML request that can be handled by the createProject operation.

Sample Request for createProject
<createProject>
	<apiUrl>https://insightlyscenario.freshbooks.com</apiUrl>
   	<authenticationToken>fa6feffa84edcfe3ae92421a4b97f927</authenticationToken>
  	<projectName>Sample Project 0006</projectName>
   	<billMethod>task-rate</billMethod>
  	<clientId>179452</clientId>
  	<rate>10</rate>
  	<description>Description for Sample Project 0006</description>
  	<hourBudget>5</hourBudget>
  	<tasks>
  	 	<task>  
        	 <task_id>321259</task_id>  
         	 <rate>5</rate>  
     	 </task>
	</tasks>
</createProject>
Related FreshBooks documentation

http://www.freshbooks.com/developers/docs/projects#project.create

Sample configuration

Following is a sample proxy service that illustrates how to connect to FreshBooks with the init operation and use the createProject operation. The sample request for this proxy can be found in createProject 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="freshbooks_createProject"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence onError="faultHandlerSeq">
         <property name="arbitraryPassword" expression="//arbitraryPassword/text()"/>
         <property name="apiUrl" expression="//apiUrl/text()"/>
         <property name="authenticationToken" expression="//authenticationToken/text()"/>
         <property name="projectName" expression="//projectName/text()"/>
         <property name="billMethod" expression="//billMethod/text()"/>
         <property name="clientId" expression="//clientId/text()"/>
         <property name="rate" expression="//createProject/rate/text()"/>
         <property name="description" expression="//description/text()"/>
         <property name="hourBudget" expression="//hourBudget/text()"/>
         <property name="tasks" expression="//tasks/node()"/>		 
         <freshbooks.init>
            <arbitraryPassword>{$ctx:arbitraryPassword}</arbitraryPassword>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <authenticationToken>{$ctx:authenticationToken}</authenticationToken>
         </freshbooks.init>
         <freshbooks.createProject>
            <projectName>{$ctx:projectName}</projectName>
            <billMethod>{$ctx:billMethod}</billMethod>
            <clientId>{$ctx:clientId}</clientId>
            <rate>{$ctx:rate}</rate>
            <description>{$ctx:description}</description>
            <hourBudget>{$ctx:hourBudget}</hourBudget>
            <tasks>{$ctx:tasks}</tasks>
         </freshbooks.createProject>         
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>