<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">

    <channel>
    
    <title>Developer Blog</title>
    <link>http://developers.freshbooks.com/index.php</link>
    <description>The FreshBooks developer blog.</description>
    <dc:language>en</dc:language>
    <dc:creator>sunir@freshbooks.com</dc:creator>
    <dc:rights>Copyright 2009</dc:rights>
    <dc:date>2009-05-20T11:32:43+00:00</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
    

    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/APIBlog" type="application/rss+xml" /><item>
      <title>Javascript library for FreshBooks API</title>
      <link>http://developers.freshbooks.com/blog/view/javascript_library_for_freshbooks_api/</link>
      <guid>http://developers.freshbooks.com/blog/view/javascript_library_for_freshbooks_api/</guid>
      <description><![CDATA[<p>Props to Milan Rukavina who has created a <a href="http://code.google.com/p/freshbooks-javascript-library/">Javascript library for FreshBooks</a>, available under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, version 2.0</a>. The library allows web applications to make calls to FreshBooks through Javascript. However, because Javascript is not permitted to make cross-domain requests, you will need to install a server-side proxy or a flash-based proxy. See the project page for details. 
</p>]]></description>
      <dc:subject>Development</dc:subject>
      <dc:date>2009-05-20T11:32:43+00:00</dc:date>
    </item>

    <item>
      <title>How To Run a Stealth Rails Application</title>
      <link>http://developers.freshbooks.com/blog/view/how_to_run_a_stealth_rails_application/</link>
      <guid>http://developers.freshbooks.com/blog/view/how_to_run_a_stealth_rails_application/</guid>
      <description><![CDATA[<p>I&#8217;ve got a little secret to share about our technology stack here at FreshBooks.&nbsp; Although by all appearances we are just another PHP shop, FreshBooks has actually been powered by <a href="http://rubyonrails.org" title="Ruby on Rails">Ruby on Rails</a> for about three years now.&nbsp; Here&#8217;s how we did it:</p>

<p>Back in late 2005 when Rails hit the mainstream, we were eager to do a complete bottom-up rewrite.&nbsp; However, management was rather concerned that our customers would react negatively to such a radical technology change.&nbsp; Would people trust their financial data with an unproven web framework that had only recently been publicly released?&nbsp; To stay on the safe side, we decided to disguise the new Rails app to appear as though it was still the old PHP version.</p>

<p>Thanks to Rails&#8217; flexibility, this was surprisingly easy to achieve.&nbsp; The heart of the disguise is a single line added to our routes.rb file:</p>

<pre name="code" class="Ruby">
  map.connect ':fake_filename.php', :controller => 'php', :action => 'dispatch'
</pre>

<p>This takes what appear to be requests for php files and sends them over to our PhpController controller.&nbsp; In the dispatch action, we lookup the &#8220;filename&#8221; that was requested and map it to an action and a controller to actually handle the request.</p>

<pre name="code" class="Ruby">
class PhpController < ApplicationController
  FILENAME_ROUTES = {
    'about' => &#123; :controller => 'about', :action => 'index' },
    'pricing' => &#123; :controller => 'pricing', :action => 'index' },
    # ...snip&#8230;
  }

  def dispatch
    redirect_to :controller => FILENAME_ROUTES[params[:fake_filename]][:controller], :action => FILENAME_ROUTES[params[:fake_filename]][:action]
  end
end
</pre>

<p>Sure, there is a little performance hit with the redirect, but we&#8217;ve found that most users don&#8217;t really notice.</p>

<p>We use Apache (with mod_proxy) to send requests to Webrick application servers.&nbsp; Although it uses a lot of memory, our Webrick cluster has held up surprisingly well.&nbsp; We&#8217;ve been meaning to switch to something more modern like FastCGI + lighttpd so we&#8217;ll keep you posted.</p>

<p>Anyway, I hope that this hasn&#8217;t come as too much of a shock to anyone. We&#8217;ve been running this setup for quite a while and felt it was time to come clean (although some people have suspected that this is what we were up to for some time now).
</p>]]></description>
      <dc:subject>FreshBooks</dc:subject>
      <dc:date>2009-04-01T22:19:08+00:00</dc:date>
    </item>

    <item>
      <title>Introducing Return to Merchant</title>
      <link>http://developers.freshbooks.com/blog/view/introducing_return_to_merchant/</link>
      <guid>http://developers.freshbooks.com/blog/view/introducing_return_to_merchant/</guid>
      <description><![CDATA[<p>For those of you out there who use FreshBooks as part of a storefront, we have a new feature just for you. FreshBooks invoices created through the API can now have a &#8220;return-to-merchant&#8221; link. When one of your customers pays an invoice that has a link, they&#8217;re given the option to return to your site via whatever URL you specify when you create the invoice. This feature is only available through the API (for now) - try it out and let us know what you think.</p>

<p><strong>Creating an invoice with a return-to-merchant link.</strong><br />
If you already have code that creates new invoices, adding return-to-merchant links when creating an invoice means adding one more element to the &lt;invoice /&gt; element in your request: &lt;return_uri&gt;YOUR URL HERE&lt;/return_uri&gt;. The URI from your API request will be used verbatim, so remember to include the http:// or https:// at the beginning.</p>

<pre name="code" class="xml">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
<request method="invoice.create">
  <invoice>
    <client_id>2</client_id>

    <lines>
      <!-- ...line items... -->
    </lines>

    <return_uri>http://invoices.example.com/thanks-for-paying</return_uri>
  </invoice>
</request>
</pre>

<p>The &lt;request_uri /&gt; element is supported in invoice.update, and it&#8217;s returned from invoice.get requests.</p>

<p><strong>What will your customers see?</strong><br />
The return-to-merchant link is shown to your customers only after they&#8217;ve paid their invoices. The payment summary page has an extra link, which will send them to&#8230; well, anywhere you want. We&#8217;ve also streamlined the payment landing page so that it acts more like the rest of FreshBooks: it now has a clear confirmation message, then the next steps to take, and finally extra information.<br />
<img src="http://community.freshbooks.com/images/uploads/devblog/return-to-merchant.gif" width="535" height="225" /></p>

<p><strong>Recurring profiles can have return-to-merchant links too.</strong><br />
You can include &lt;return_uri /&gt;s in recurring.create and recurring.update, too. When an invoice is created from a recurring profile, some variable substitution takes place, so that the generated link can include a reference back to the invoice.</p>

<p>Let&#8217;s say you set your recurring profile&#8217;s return_uri to</p>

<p><code>http://invoices.example.com/invoices/::invoice id::/paid</code></p>

<p>The invoice ID (invoice_id in the invoice.get API response) of the generated invoices will show up in each invoice&#8217;s &lt;recurring_uri&gt; - for example, if the generated invoice ID is 16, then the return-to-merchant link will point to</p>

<p><code>http://invoices.example.com/invoices/16/paid</code></p>

<p>This works with ::invoice number:: and the invoice_number of the generated invoices, too.</p>

<p><strong>What about&#8230;</strong><br />
There are lots of things we&#8217;d like to do with this in the future to make the FreshBooks API support more scenarios. I&#8217;m sure some of you have software you&#8217;d like to have notified when a customer pays an invoice, for example - that comes up a lot with PayPal&#8217;s basic integration, which uses a similar &#8220;return to merchant&#8221; feature to implement notifications. We&#8217;d love to hear other ways of extending the API to better fit how you want to use FreshBooks.
</p>]]></description>
      <dc:subject>API Additions</dc:subject>
      <dc:date>2009-03-26T18:37:25+00:00</dc:date>
    </item>

    <item>
      <title>Where’s my API key?</title>
      <link>http://developers.freshbooks.com/blog/view/wheres_my_api_key/</link>
      <guid>http://developers.freshbooks.com/blog/view/wheres_my_api_key/</guid>
      <description><![CDATA[<p>With our recent <a href="http://www.freshbooks.com/blog/2009/03/25/interface-redesign-settings-refreshed/">redesign of the system settings and preferences</a> pages, we&#8217;ve made it one step easier for you to access your API key.&nbsp; Here are the steps on how to locate your API key under the new redesign:</p>

<p><strong>1. Click on your white &#8220;My Account&#8221; link on the top right corner.</strong><br />
<img src="http://community.freshbooks.com/images/uploads/devblog/api1.gif" width="535" height="121" /></p>

<p><strong>2. Click on your &#8220;FreshBooks API&#8221; sub-tab on the top right.</strong><br />
<img src="http://community.freshbooks.com/images/uploads/devblog/api2.gif" width="535" height="209" /></p>

<p><strong>3. Click on your checkbox next to &#8220;Yes, I agree to the API terms of service&#8221;.</strong><br />
<img src="http://community.freshbooks.com/images/uploads/devblog/api3.gif" width="535" height="150" /></p>

<p><strong>4. Your &#8220;API URL&#8221; and &#8220;Authentication Token&#8221; will become visible on your screen.</strong><br />
<img src="http://community.freshbooks.com/images/uploads/devblog/api4.gif" width="535" height="177" /></p>

<p>We hope you have enjoyed this update.
</p>]]></description>
      <dc:subject>Integrations</dc:subject>
      <dc:date>2009-03-25T18:30:45+00:00</dc:date>
    </item>

    <item>
      <title>Updates to recurring billing</title>
      <link>http://developers.freshbooks.com/blog/view/updates_to_recurring_billing/</link>
      <guid>http://developers.freshbooks.com/blog/view/updates_to_recurring_billing/</guid>
      <description><![CDATA[<p>We made some big updates to recurring billing in today&#8217;s release that will make life much easier for many of you. If you&#8217;re running a subscription-based billing service on top of FreshBooks, please take note:</p>

<p><strong>Recurring invoices now default to auto-bill</strong><br />
We have changed the default so that recurring invoices automatically bill client credit cards for future invoices, rather than asking the client if they&#8217;d like this. We feel this fits better with everyone&#8217;s expectations of what should happen. You should expect less confusion around customers needing to enter credit cards multiple times. Note that you will need to purchase enough auto-bills in your system.</p>

<p><strong>Recurring profiles starting today will invoice immediately.</strong><br />
Previously, you could only create recurring profiles starting on a future date. Now, if you create a recurring profile with today&#8217;s date, an invoice will be created and sent immediately. The response XML includes the created invoice_id.</p>

<p>This means you can set up a recurring profile immediately at the time of initial purchase, and then immediately redirect your customer to pay the invoice. This should dramatically speed up the time it takes for you get paid, as well as lower attrition rates on payment.</p>

<p>Hopefully these changes will really help your business. Let us know how it goes!</p>

<p><strong>Enjoy!<strong></p>

<p>
</p>]]></description>
      <dc:subject>API Additions</dc:subject>
      <dc:date>2009-02-11T18:26:59+00:00</dc:date>
    </item>

    <item>
      <title>FreshBooks iPhone Application GUI</title>
      <link>http://developers.freshbooks.com/blog/view/freshbooks_iphone_application_gui/</link>
      <guid>http://developers.freshbooks.com/blog/view/freshbooks_iphone_application_gui/</guid>
      <description><![CDATA[<p>I was tasked with designing the FreshBooks iPhone application. The first thing I discovered was that Apple makes life unnecessarily difficult for people trying to design applications that match the iPhone style. They don&#8217;t have any ready-made GUI resources available for mockups. Even worse, their stock controls in Interface Builder don&#8217;t have all the visual options available that they use in their applications. Want a big red or green button like the ones in the clock application? Sorry, no can do. You will need to create your own.</p>

<p>This forced me to take screenshots of the stock iPhone applications and chop them into pieces in order to create mockups. The results were similar to the stock applications, but they felt dreary. They did not feel like something FreshBooks would create. They were too dark and ominous. We realized we were missing the opportunity to create something that would be distinctly FreshBooks&#8212;something bright, colorful, and fresh.</p>

<p>So we went back to the drawing board. While we wanted to keep the iPhone design guidelines, I also wanted to infuse the application with the FreshBooks brand. A new graphical aesthetic was needed; one that could be applied to all future FreshBooks applications, widgets, and gadgets. What we ended up with is very similar to the standard iPhone GUI, but makes use of a much fresher and bolder color palette.</p>

<p>In order to streamline future work on the iPhone application a proper set of reusable GUI elements were created. We are now making these elements available to all our 3rd party developers to help you with your creations. This set of GUI elements should make it painless to develop iPhone applications that look great and fit the FreshBooks brand.</p>

<p><img src="http://community.freshbooks.com/images/uploads/devblog/iphoneguiv1.jpg" width="527" height="307" /></p>

<p>This file only includes the iPhone GUI elements that we needed for the FreshBooks Time Tracking application. For additional elements take a look at the Teehan + Lax iPhone GUI PSD or, if you use a Mac, the Ultimate iPhone Stencil for OmniGraffle.</p>

<p><a href="http://freshbooks.com/downloads/gui/FreshBooks%20iPhone%20GUI%201.0.psd">Download the FreshBooks iPhone GUI PSD v1.0</a>
</p>]]></description>
      <dc:subject>Design</dc:subject>
      <dc:date>2009-02-11T18:22:30+00:00</dc:date>
    </item>

    <item>
      <title>Are you using Keep-Alive?</title>
      <link>http://developers.freshbooks.com/blog/view/are_you_using_keep-alive/</link>
      <guid>http://developers.freshbooks.com/blog/view/are_you_using_keep-alive/</guid>
      <description><![CDATA[<p>Do you use the FreshBooks API? Do you make multiple requests in a session? Is it painful waiting for each and every request to complete?</p>

<p>If so, you have to ask if you&#8217;re getting the best performance out of the API. When one piece of work at your end may entail 3-4 API requests, the average speed of making requests can have a big impact on your own application&#8217;s performance.</p>

<p>Our web servers are set up to allow <a href="http://en.wikipedia.org/wiki/HTTP_persistent_connection">HTTP persistent connections</a> which eliminates the delay of opening a new HTTP connection (and renegotiating SSL!) for each API request.</p>

<p>In our own testing, this can result in up to 50% time savings over the course of a multi-request interaction! For example, cURL in PHP automatically takes advantage of persistent connections, if you don&#8217;t force it to make a new connection each time:</p>

<pre name="code" class="php">
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_USERPWD, $token);
$request = get_first_request();
while ($request) {
  curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
  $request = get_next_request($response = curl_exec($ch));
}
curl_close($ch);
</pre>

<p>Ben&#8217;s looking to update the FreshBooks Ruby wrapper to make use of persistent connections. Enjoy!
</p>]]></description>
      <dc:subject>Development</dc:subject>
      <dc:date>2009-01-30T18:07:42+00:00</dc:date>
    </item>

    <item>
      <title>Expense categories added!</title>
      <link>http://developers.freshbooks.com/blog/view/expense_categories_added/</link>
      <guid>http://developers.freshbooks.com/blog/view/expense_categories_added/</guid>
      <description><![CDATA[<p>Well that makes sense now. Now the little &lt;category_id&gt; on expense operations means something. With the introduction of Expense Categories to the API, you now have the flexibility to manipulate them freely.&nbsp; This includes any taxes that may apply.</p>

<p>The taxation mechanism is flexible to your requirements, but it&#8217;s also a relationship that you are required to maintain.&nbsp; &lt;tax1&gt; and &lt;tax2&gt; can be used to track your own tax ID against chosen categories, and then calculated and displayed on the individual expense via &lt;tax1_name&gt;, &lt;tax1_percent&gt; and &lt;tax1_amount&gt;.&nbsp; Three more fields for &lt;tax2_ now appear on expense.get operations as well, and match the preceeding format.</p>

<p>These changes have been reflected in the Expenses API documentation, and a new link for categories has been added.&nbsp; Please feel free to discuss or ask questions in the forum.
</p>]]></description>
      <dc:subject>API Additions</dc:subject>
      <dc:date>2008-12-17T19:58:05+00:00</dc:date>
    </item>

    <item>
      <title>Ch-ch-ch-changes… introducing &amp;lt;links/&amp;gt;</title>
      <link>http://developers.freshbooks.com/blog/view/ch-ch-ch-changes_introducing_links/</link>
      <guid>http://developers.freshbooks.com/blog/view/ch-ch-ch-changes_introducing_links/</guid>
      <description><![CDATA[<p>The object URI changes we made a while back appear to be helpful.&nbsp; So much so, we&#8217;ve been getting some granular requests that are object specific, and we can see some of the benefits in bringing them to you.&nbsp; But first, and a FreshBooks API first, we&#8217;ve added our first deprecation to the API.</p>

<p>I&#8217;ve secretly hated the look/feel/sound of our current URI responses in the form of &lt;url&gt; and &lt;auth_url&gt; on invoices, estimates and clients.&nbsp; While they still exist today, you may notice a new property on the &lt;url&gt; and &lt;auth_url&gt; elements, and that is &#8216;deprecated=&#8220;true&#8221;&#8217;.&nbsp; Make use of them while you can, because in some future update, they will just vanish.&nbsp; API version 3?&nbsp; 2.2? I promise nothing.&nbsp; Consider this a 2 minute warning, of a sort.</p>

<p>The new format consists of a &lt;links&gt; parent which will contain &lt;client_view&gt;, replacing &lt;url&gt;, and &lt;view&gt;, replacing &lt;auth_url&gt;.&nbsp; Your output should look something like this:</p>

<pre name="code" class="xml">
  <links>
    <client_view>https://sample.freshbooks.com/inv/514-24-d4622</client_view>
    <view>https://sample.freshbooks.com/inv/514-24-d4622-z</view>
  </links>
</pre><p>
 <br />
Links is part of the &lt;invoice&gt;, &lt;estimate&gt; and &lt;client&gt; response when you execute the appropriate .get operation successfully.</p>

<p>Our object specific update of the day is just for invoice.get and fits into the &lt;links&gt; response element.&nbsp; The new link directly takes an authenticated administrator to the target invoice for editing.&nbsp; It should look something like this:</p>

<pre name="code" class="xml">
  <links>
    <edit>https://sample.freshbooks.com/inv/514-24-d4622-e</edit>
  </links>
</pre>

<p>As always, comments and further suggestions are welcome and encouraged.
</p>]]></description>
      <dc:subject>API Additions</dc:subject>
      <dc:date>2008-12-08T19:59:22+00:00</dc:date>
    </item>

    <item>
      <title>Expenses and Staff APIs are released!</title>
      <link>http://developers.freshbooks.com/blog/view/expenses_and_staff_apis_are_released/</link>
      <guid>http://developers.freshbooks.com/blog/view/expenses_and_staff_apis_are_released/</guid>
      <description><![CDATA[<p>At long last, I present to you, the people (the Freshies), the Expenses API!</p>

<p>&lt;suitably long pause for applause&#8230; keep going I can wait.&gt;</p>

<h4>Notes on the Expenses API</h4><p>
We&#8217;re releasing the Expenses API in two phases. This phase contains the core Expenses data. The next phase will include Expense Categories. That will be out Very Soon(tm). (famous last words)</p>

<p>Expenses are also dependent on staff and client associations; so, in the expenses response, we&#8217;ve provided a staff_id and a client_id. You can use the Clients API to acquire client details, and the new Staff API to acquire staff details.</p>

<h4>Notes on the Staff API</h4><p>
We&#8217;re also releasing the Staff API in phases. For now, the Staff API only has the staff.get and staff.list commands. That should be enough to make the Expenses API useable.</p>

<p>Please note that staff_id 1 is the administrative account.
</p>]]></description>
      <dc:subject>API Additions</dc:subject>
      <dc:date>2008-12-03T20:05:48+00:00</dc:date>
    </item>

    
    </channel>
</rss>
