API Connector Documentation
Import Quaderno Data to Google Sheets
In this guide, we’ll walk through how to pull data from the Quaderno API directly into Google Sheets, using the API Connector add-on for Sheets.
We'll first get an API key from Quaderno, and then set up a request to pull in invoice data to your spreadsheet.
Contents
- Before You Begin
- Part 1: Get your Quaderno API Key
- Part 2: Pull Quaderno API Data into Sheets
- Part 3: More Example API URLs
- Part 4: Handle Pagination
- Part 5: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Get Your Quaderno API Key
- While logged into your Quaderno account, click your Profile icon and then API keys from the header bar.
- Copy down your Private Key. That is the only value we need here.
- One last step. Quaderno uses Basic Authentication, so you need to encode your API key. To encode your credentials, type your API key into this form, using the format
{Private key}:x
(your private API key, then a colon, and then the letter x). Your encoded credentials will appear underneath.
The encoding script runs in your browser, and none of your credentials are seen or stored by this site.
Part 2: Pull Quaderno API Data into Sheets
For this example, we'll get a list of invoices. Where it says your_subdomain
, enter in your own subdomain, and where it says base64_encoded_key
, enter in your encoded value from above. The dates shown represent a range, where the first date is the "from" date and the second date is the "to" date.
- Open up Google Sheets and click Extensions > API Connector > Open > Create request.
- In the request form enter the following:
- Application:
Custom
- Method:
GET
- Request URL:
https://your_subdomain.quadernoapp.com/api/invoices.json?limit=100&date=2023-03-01,2023-03-31
- Headers:
Authorization
:Basic base64_encoded_key
- Application:
- Create a new tab and click Set current to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see a list of your Quaderno invoices in your Google Sheet:
Part 3: More Example API URLs
You can check the documentation for the full list of available API requests, but if you just want to jump in, you can play around with the URLs you enter in the API URL path field. Try the following examples:https://YOURSITE.quadernoapp.com/api/contacts.json
https://YOURSITE.quadernoapp.com/api/receipts.json
https://YOURSITE.quadernoapp.com/api/credits.json
https://YOURSITE.quadernoapp.com/api/expenses.json
https://YOURSITE.quadernoapp.com/api/expenses.json
https://YOURSITE.quadernoapp.com/api/estimates.json
https://YOURSITE.quadernoapp.com/api/recurring.json
https://YOURSITE.quadernoapp.com/api/items.json
https://YOURSITE.quadernoapp.com/api/payments.json
Part 4: Handle Pagination
Quaderno limits the number of records returned in each request. By default, only 25 records will be returned unless you change the limit
parameter to 100.
To get more than 100 records, you need to fetch URL provided in the X-Pages-NextPage
header. With API Connector, you can do this automatically with pagination handling, like this:
- Pagination type :
next page URL
- Next page path:
X-Pages-NextPage
- Run until: choose when to stop fetching data
Part 5: API Documentation
Official API documentation: https://developers.quaderno.io/api/
Hello,
How can I get only fresh data and avoid duplicates?
Thank you!
Hey Miguel, you'd add the date range to your request URL like this:
https://domain.quadernoapp.com/api/invoices.json?date=2021-01-01,2021-01-31
So you'd set that date range such that it only pulls in new data. You can make this automatic by using a cell reference to populate the date so you don't need to keep updating your request. You can see more about this in this article: Use Cell Values in Requests