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:
Apipheny is a free API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to API data sources, easily.
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.
Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new
In your WordPress dashboard, navigate to Forms:
Under Forms, click the Settings menu item:
Click Rest API, then check the Enabled checkbox:
After you’ve enabled the API access, click the Add Key button to generate an API key:
Complete the key description, set permissions, and then click the Add Key button:
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:
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:
If you scroll down, you’ll find the Endpoints section. Click the Endpoints link to display available endpoints for this API:
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.
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
Here’s what your API request should look like when entered into Apipheny, if you’re following the same example as us:
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.
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.
Schedule requests for automatic updates
Reference cell values in requests
Stack multiple URLs in a single request
Crypto API Tutorials: