In this tutorial, you’ll learn how to connect the Harvest REST API to Google Sheets in 5 steps:

  1. Install the Apipheny Add-on
  2. Get a Harvest Access Token and Account ID
  3. Choose a Harvest API Endpoint
  4. Enter the Harvest API request into Apipheny
  5. Run the Harvest API request in Google Sheets

Step 1.) Install and open the Apipheny Add-on in Google Sheets

Harvest is a popular time tracking, invoicing, and reporting software for employee timesheets and billing.

To pull data from the Harvest API into Google Sheets, first install and open the Apipheny Google Sheets add-on.

Apipheny is an API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited API data sources, save your API requests, schedule API requests, and more.

Click here for more information about Apipheny on the homepage. There’s a 30-day free trial included, then it’s $19-$29/month.

1. Install Apipheny by opening the following link on desktop and then clicking the Install button on the page: https://gsuite.google.com/marketplace/app/apipheny/966163326746

Install Apipheny
Install Apipheny

2. After you’ve installed Apipheny, open a Google Sheet and then click on Add-Ons in the menu at the top. When you click “Add-ons”, you should see Apipheny in the menu.

Just click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets:

Open Apipheny
Open Apipheny

Step 2.) Get your Harvest Access Token and Account ID

1. After logging in to your Harvest account, go to the developers page here: https://id.getharvest.com/developers

Next, click the Create New Personal Access Token button:

Create new Harvest personal access token
Create new Harvest personal access token

2.  Choose a name for your Harvest API token and click the Create Personal Access Token button:

Enter a name then click "Create Personal Access Token"
Enter a name then click “Create Personal Access Token”

3. Now, your token has been created and displayed. Copy and paste your token and your Account ID to a safe location because you will need it in the next steps:

Harvest Personal Access Token and Account ID
Harvest Personal Access Token and Account ID

Step 3.) Choose a Harvest API Endpoint

In this section, we’ll show you how to browse the Harvest API documentation and choose an API Endpoint URL that retrieves the information you need from your Harvest account.

And endpoint is the part of the API request that tells Harvest which data you’re trying to pull.

If you already know your endpoint, or you want to use the same example endpoint as us, just skip to Step 4.

To choose a Harvest endpoint, first open the Harvest API documentation page here: https://help.getharvest.com/api-v2/

Harvest API Documentation
Harvest API Documentation

The various sections of the documentation appear as cards on the page.

In the API Introduction section, click on the Overview link. On the Overview page, you will find information about API requests and their authentication methods.

The other cards on the API documentation page are API groups linking to individual APIs, with each API page linking to a list of its endpoints.

Harvest API Overview
Harvest API Overview

Click on the OAuth2 or Personal Access Tokens link and a page with the authentication descriptions and examples will be displayed.

Here you can also find the root URL for all API endpoints:

https://api.harvestapp.com/v2
Personal Access Tokens - Harvest API
Personal Access Tokens – Harvest API

As an example, let’s see how the Projects API reveals its description and a summary listing of its endpoints:

Harvest Projects API documentation
Harvest Projects API documentation

This is the endpoint for the Projects API:

https://api.harvestapp.com/v2/projects

The documentation contains a short description for each endpoint, as well as the HTTP method used (eg. GET) and the link you should append to the root API URL for querying this endpoint (eg. /v2/projects):

For endpoints that accept parameters, this documentation page is where you would find them listed and explained, along with example inputs and responses.

Step 4.) Enter the Harvest API URL into Apipheny

Now, open your Google Sheet again, with the Apipheny sidebar open (screenshot below).

With the Import tab open, enter these details into the Apipheny add-on:

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the GET method.

API URL: In Step 3 we explained how you can find the Harvest REST API endpoint that you need. Now that you have an endpoint, copy the complete URL into the Apipheny add-on, where it says API URL Path, followed by any GET parameters required for your query.

For this example, we are using the Users API Endpoint, to get a list of users, and this is the URL we are using:

https://api.harvestapp.com/v2/users

Headers: In the Headers section in Apipheny, add two rows with the following keys and values:

Key 1:
Harvest-Account-Id
Value 1:
<account_id>
Key 2:
Authorization
Value 2:
Bearer <your_access_token>

<your-access-token> and <account_id> are the values you generated previously, in Step 2. Note that there should be a space between “Bearer” and “<your_access_token>”. Do not include the carrots “<>” when entering your access token and account ID.

The Harvest-Account-Id and Authorization keys and values are required, so you should add them to the Apipheny add-on like this:

Harvest API request entered in Apipheny
Harvest API request entered in Apipheny

Step 5.) Run the Harvest API Request in your Google Sheet

Lastly, click the Run button at the bottom of the Apipheny add-on and then your Harvest data will automatically be imported into your Google Sheets, and it should look like this:

Harvest API data imported into Google Sheets
Harvest API data imported into Google Sheets

After making a successful request to the Harvest API, try querying a different endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:

  • Save and schedule your API request
  • Make a POST request (if available)
  • Use the custom =APIPHENY() function to call the API request inside your spreadsheet
  • Create an API request by referencing the value of a cell in the API URL with three curly braces eg. {{{Sheet1!A1}}}

Related articles:

Related Posts

Leave a Comment