API Integration – Google Sheets App Script

Estimated reading: 3 minutes 56 views

In this tutorial we will leverage the FastCredit Pro plugin’s API with Google Sheets and an App Script. By the end of this tutorial, you’ll have a solid understanding of how to interact with the FastCredit Pro API to manage user credits directly from a Google Sheet. This is perfect for anyone looking to automate and bulk manage their user credit management tasks. Let’s get started!

Google Sheet / App Script Link

https://click.fastcreditpro.com/app-script


Part 1: Setting Up Your Environment

In this part, we’ll prepare our working environment by copying a script and pasting a specific link into your browser to access a Google Sheet.

Steps

  1. Copy the Link: At the beginning of this tutorial is a link. Copy it.
  2. Open the Link: Paste the copied link into your browser. You’ll be presented with a Google Sheet.
  3. Make a copy of the Google Sheet: This will save a copy to your Google Drive.

Part 2: Enable Extensions and Edit Config File

In this section, we’ll guide you through enabling required extensions and modifying the configuration file in the Google App Script linked to the Google Sheet.

Steps

  1. Navigate to App Script: In your Google Sheet, go to Extensions and then to App Script.
  2. Access Configuration File: You will see a configuration file within the script named config.gs
  3. Edit Domain, Username, and Password: Replace the placeholders for the domain, username, and password in the config file with the actual values. Make sure to enter the details within the quotes.

Part 3: Exploring the API and Script

Before we execute the script, let’s take a quick look at how the FastCredit Pro API works within the Google App Script.

Steps

  1. Understand Payload: Scroll through the script to understand the payload. The payload contains the user ID and other parameters that interact with your WordPress site.
  2. Observe API Endpoints: Notice how different API endpoints are integrated into the script.

Part 4: Running the Script

Now that we’re familiar with the setup and the API, let’s go ahead and run the script.

Steps

  1. Authorization: When you run the script for the first time, it will prompt you for authorization. Go ahead and grant it.
  2. Execute: Use the custom menu that appears in your Google Sheet to execute functions like ‘Get All Users and Credits’.

Part 5: Adding and Updating User Credits

Finally, let’s go over how to add and update user credits directly from the Google Sheet.

Steps

  1. Add Credits: Use the ‘Add Credits’ box in the Google Sheet to specify the amount of credit to add to a user account.
  2. Update Credits: Alternatively, you can directly input the total credits for a user to update their credit balance.

Conclusion

You’ve now successfully learned how to manage user credits in WordPress using the FastCredit Pro plugin and Google App Script. This method offers you a centralized and automated way to manage credits, thus streamlining your workflow.

If you have further questions, need additional assistance, or would like to explore more about the FastCredit Pro plugin, don’t hesitate to reach out to us. We’re here to help you excel in your endeavors.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this Doc

API Integration – Google Sheets App Script

Or copy link

CONTENTS
Scroll to Top