Gravity Forms is an easy to use WordPress plugin that makes it easy to create custom forms on your WordPress website.

In this tutorial, you will learn how to connect the Gravity Forms REST API to Google Sheets in 5 steps:

  1. Install the Apipheny Add-on
  2. Generate a Gravity Forms API key
  3. Choose your Gravity Forms endpoint
  4. Enter your Gravity Forms API request into Apipheny
  5. Run the Gravity Forms API request in your Google Sheet

Step 1.) Install and open the Apipheny add-on for Google Sheets

Apipheny is an API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to unlimited API data sources, make unlimited API requests, and more. There is a 30 day free trial included.

1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install

2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.

In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.

open apipheny

Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new

Step 2.) Generate an Gravity Forms API key

In your WordPress dashboard, navigate to Forms:

Click "Forms" in the Gravity Forms menu of your WordPress site
Click “Forms” in your WordPress site

Under Forms, click the Settings menu item:

Go to your Gravity Forms settings
Go to your Gravity Forms settings

Click Rest API, then check the Enabled checkbox:

Enable the Rest API in your Gravity Forms settings
Enable the Rest API in your Gravity Forms settings

After you’ve enabled the API access, click the Add Key button to generate an API key:

Generate your Gravity Forms API key
Generate your Gravity Forms API key

Complete the key description, set permissions, and then click the Add Key button:

Complete the process by clicking "Add Key"
Complete the process by clicking “Add Key”

Your key is now generated, along with a secret value. Copy and paste both of these values to a safe location, because they will no longer be available once you leave this page and you will need them in the next steps:

Copy and paste your key and secret to a safe location for use in the later steps
Copy and paste your key and secret to a safe location for use in the later steps

Step 3.) Choose a Gravity Forms Endpoint URL

In this section, we’ll show you how to browse the Gravity Forms API documentation to find the API URL endpoint that retrieves the information you need from your Gravity Forms account. If you already know your Gravity Forms API URL, or you want to use the same example API URL as us, just skip to Step 4.

First, open the Gravity Forms API documentation page: https://docs.gravityforms.com/rest-api-v2/

The menu on the left contains links to the Getting Started, User Guides, Your Gravity Forms Account, Developers and Knowledge Base sections. If you click the Developers section, you’ll find the Rest API v2 Guide:

Gravity Forms API documentation
Gravity Forms API documentation

If you scroll down, you’ll find the Endpoints section. Click the Endpoints link to display available endpoints for this API:

Gravity Forms API endpoints
Gravity Forms API endpoints
Gravity Forms API endpoint documentation example
Gravity Forms API endpoint documentation example

All API calls to Gravity Forms should be made to this base URL: https://localhost/wp-json/gf/v2/

localhost” must be replaced with your domain name.

An example endpoint is GET /entries/[ENTRY_ID], and this is what the API URL looks like put together:

https://localhost/wp-json/gf/v2/entries/

Each endpoint’s documentation contains its HTTP method (GET), its path structure, a short description of the endpoint’s purpose, its complete path, an example response and the list of its required/optional properties.

Gravity Forms API endpoint documentation example
Gravity Forms API endpoint documentation example

Step 4.) Enter your Gravity Forms API request into Apipheny

Now go back to your Google Sheet and make sure that the Apipheny add-on is open to the “Import” tab. With the Import tab open, enter these details into the 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 GravityForms REST API endpoint that you need. Now copy and paste your complete GravityFormsAPI URL into the Apipheny add-on, where it says API URL Path, followed by any GET parameters required for your query (if applicable).

For this example, we are using the Entries endpoint, that gets all entries. This is what the whole URL looks like:

https://localhost/wp-json/gf/v2/entries

If you are following the same example as us, you can copy and paste this URL into Apipheny, but don’t forget to replace localhost with your domain name.

Headers: In the Headers section of the Apipheny add-on, add two rows with the following keys and values:

Header 1
Key:
Authorization
Value:
Basic base64_encoding

Header 2
Key:
Content-Type
Value:
Application/json
  • For the value of the first header, you’re going to need to replace base64_encoding with a base64 encoded version of your API key and secret. You can do that by entering your key and secret like this: consumer_key:consumer_secret into this website: https://www.base64encode.org/, then click encode.
  • Consumer_key and consumer_secret are the values that you previously obtained, in Step 2.
  • When enter header 1 value, make sure to enter the word “Basic”, then a space, then your encoded value.

Here’s what your API request should look like when entered into Apipheny, if you’re following the same example as us:

Gravity Forms API request entered into Apipheny
Gravity Forms API request entered into Apipheny

Step 5.) Run the Gravity Forms API Request

Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the Gravity Forms API data to be imported into your Google Sheet.

Gravity Forms data in Google Sheets
Gravity Forms data in Google Sheets

That’s it! You’ve successfully integrated Gravity Forms with Google Sheets.

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


Crypto API tutorials and more:


API Tutorials



API Knowledge

What is an API?
What is an API URL?
What are parameters?
What is an endpoint?
What is an API key/token?
What is basic authentication?
What are headers?
What is a GET request?
What is a POST request?