HOW TO MAKE API CALLS TO FLOOKUP
Introduction to Making API Calls
This feature is only available on the Flookup Professional Plus plan and, therefore, you will need to authenticate the project in order to make API calls to our web app. The API exposes the lookup, match and dedupe functions of Flookup.
In order access these functions, you will need to interact with our web app using the UrlFetchApp function. The endpoint URL will be sent to your PayPal email address immediately after you activate your free trial or subscription. If you do not receive any email from us within 1 minute of your subscription, please get in touch with us immediately.
Plan Features
Due to the nature of this project, this particular plan will automatically renew every month until you cancel your subscription in order to provide an uninterrupted service.
Here are the key differentiating factors to expect from the Flookup Professional Plus plan:
Number of users: 1
Duration: 1 month
Number of requests: Unlimited / LEARN MORE
Pricing: $39.99 / Month / 5-DAY FREE TRIAL
License restrictions: None. The API is free to use in your own personal, public or commercial projects.
How to Make API Calls from Apps Script
In this example, our assumption is that the function "addNumbers" is one of the exposed API functions.
In order to call this function from your project, you will need to write your calling function as illustrated here.
Take note of the required variables like the endpoint URL, the function name, the function parameters and arguments.
Do not forget to convert your response variable using the JSON.parse() method.
The API response is an object with the following properties:
status: This property returns the status of the data cleaning process. A value of "complete" indicates that the data has been fully processed, while a value of "incomplete" indicates that the data has not been fully processed.
data: This property returns a value that is the actual result of the data cleaning process for use in your Apps Script project.
SubStatus
Parameters: [user_id]
This function synchronises with the Flookup database to establish whether your subscription is active or inactive. You must run it at the beginning or your subscription or if you change your subscriber details but you only need to run it once.
Your user_id can be found in the confirmation email we sent you immediately after you subscribed.
CancelSub
Parameters: [profile_id]
Use CancelSub to cancel your Flookup Professional Plus subscription. If you have any other active Flookup subscriptions, running this function will not cancel them.
When you execute this function, a message will be displayed confirming whether the subscription was successful or not. Successful cancellations are further verified with an email from PayPal.
Your profile_id can be found in the confirmation email that PayPal sent you immediately after you subscribed.
FuzzyLookup
Parameters: [lookup_value, table_array, lookup_col, index_num, threshold]
Use the FuzzyLookup function to search for a value in any column of a range of cells, and then return a match from a specified column of that same range of cells.
FuzzyLookup Parameters
lookup_value: This determines the specific value or values you are looking for within any column of the "table_array" parameter. The "lookup_value" can be a reference to one cell e.g. A1 or a range covering multiple rows e.g. A1:A500.
table_array: This determines the range of cells e.g. B1:E500 that contains the data to be returned or merged. The values in the specified or target column of "table_array" are compared to the values in "lookup_value". These values can be text, numbers, or any other type of data.
lookup_col: This determines the index of the "table_array" column that this function will search through. A "lookup_col" value of 1 means the function will search the first column in "table_array", a value of 2 will search the second column, and so on. These values must always be greater than 0.
index_num: This determines the column index in the "table_array" from which data should be returned. If the "index_num" is 1, the value from the first column in the "table_array" is returned. If it is 2, the value from the second column is returned, and so on. These values must always be greater than 0.
threshold: This optional parameter determines whether FLOOKUP should return exact or approximate matches. It represents the similarity level below which results will not be returned from "table_array". Valid values range from 0 for no filtering to 1 for exact matches. The default value is set to 0.6.
SoundMatch
Parameters: [lookup_value, table_array, lookup_col, index_num]
Use the SoundMatch function to lookup values in any column and return values based on the Soundex algorithm for comparing strings are pronounced in English.
SoundMatch Parameters
lookupValue: The value to search in the column of the "tableArray". The "lookupValue" argument can be a text entry, a single cell reference or a range of many cells.
tableArray: The range of cells that contains data that will be returned or merged. The values in the user-specified column of "tableArray" are systematically compared to "lookupValue". These values can be text, numbers or anything else.
lookupCol: The column index in "tableArray" which will be searched by the function. A "lookupCol" value of 1 searches the first column in "tableArray", a "lookupCol" value of 2 searches second column in "tableArray", and so on. Values must be greater than 0.
indexNum: The column index in the "tableArray" argument from which the matching value must be returned. An "indexNum" argument of n returns values in the nth column in "tableArray". Values must be greater than 0.
uList
Parameters: [col_array, index_num, threshold, operation]
You can use the uList function to return unique values from any list of text entries based on their relative percentage or sound similarities.
uList Parameters
col_array: This a range of one or more columns from which you intend to extract unique text entries and discard duplicates e.g. A1:C200.
index_num: This optional parameter is an index number that represents the column in "col_array" that is going to be analysed for duplicates with the view of extracting unique values. If no input is made, the first column of "col_array" will be analysed.
threshold: This optional parameter determines whether ULIST should extract exact or approximate matches. It represents the relative percentage similarity between any two text entries in the target column of "col_array", below which text entries are considered unique and above which text entries are considered to be duplicates. The default value is set at 0.6.
operation: This parameter determines what mode uList will execute. In order to extract unique values by percentage similarity, use by_percentage and in order to extract unique values by sound as pronounced in English, use by sound. If you do not enter anything, it will extract by percentage.
Error Handling
!SubInactive: You have not activated Flookup or you are using the wrong user account.
!IndexError: Your index number that is less than 1 or greater than the number of columns available in the search table.
!RankError: You have entered a rank figure that is less than 1.
!ThresholdError: You have entered a figure that is less than 0 or greater than 1.
!NoMatchFound: There are no matches available for the current parameters you have set.
---
For assistance with any issues or suggestions related to the Flookup Data Wrangler API, please contact us.
FAQs About Apps Script Web Apps
What is an Apps Script web app? A web app in Google Apps Script is a script that can be accessed over the internet. It can serve HTML, JSON, or other data, and can respond to user interactions and inputs.
Is there a limit to the number of requests I can make with the Apps Script web apps? Yes, Google imposes quotas on the Apps Script API usage to ensure fair usage. These include daily quotas, rate limits, and maximum execution time. One key limit is that you cannot make more than 30 simultaneous executions.
What is the difference between doGet and doPost in a web app? The doGet and doPost of Apps Script are functions that handle HTTP-GET and HTTP-POST requests, respectively. doGet is generally used when the request is simply retrieving data, while doPost is generally used when the request is sending data to be processed.
How do I handle the response from a web app? The response from a web app is returned as an HTTP-Response object. You can use the getContentText() method to get the body of the response as a string. If the response is JSON, as with the case with the API discussed on this page, you can then use JSON.parse() to convert it into a JavaScript object.