FreshBooks API

1,367 views
1,193 views

Published on

FreshBooks API overview for HackDays

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,367
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

FreshBooks API

  1. 1. The API
  2. 2. How It Works XML Request: Invoice.list POST POST POST POST POST POST POST POST POST FreshBooksYou XML Response: Invoices
  3. 3. What a Request Looks Like <request  method="[RESOURCE].[METHOD]">        [parameters] </request>Some Resources Some Methods Invoice Create Clients Get Estimate Update Expense List Payment Delete
  4. 4. AuthenticationPost to HereYour Credentials
  5. 5. Sending a Requestcurl -u b6b5d45904881a749de87656699933ee:Xhttps://darthvader.freshbooks.com/api/2.1/xml-in -d<request  method="invoice.create">        <invoice>                <client_id>2</client_id>                <lines>                        <line>                                <name>Power  converters</name>                                <unit_cost>35.00</unit_cost>                                <quantity>3</quantity>                        </line>                </lines>        </invoice></request>
  6. 6. What a Successful Response Looks Like<!-­‐-­‐?xml  version="1.0"  encoding="utf-­‐8"?-­‐-­‐><response  xmlns="http://www.freshbooks.com/api/"  status="ok">    <invoice_id>115236</invoice_id></response>
  7. 7. What a Failed Response Looks Like<!-­‐-­‐?xml  version="1.0"  encoding="utf-­‐8"?-­‐-­‐><response  xmlns="http://www.freshbooks.com/api/"  status="fail">    <error>Invalid  value  for  field  client_id.                    Client  does  not  exist.</error>    <code>40060</code>    <field>client_id</field></response>
  8. 8. Client Libraries refreshbooks ruby-freshbooksMore resources & sample code at http://developers.freshbooks.com
  9. 9. Here’s a Google Chrome Extension for Experimenting with our APIhttp://developers.freshbooks.com/helper-libraries/

×