What is the "Be The API Technique"?

  • 0
  • 1
  • Question
  • Updated 6 years ago
  • Answered
The Be The API Technique is a method of extracting any information within any QuickBase page into an custom API. In a nutshell, if the information you want to display or manipulate is within some QuickBase page the Be The API Technique can access it through script. The information that can be extracted from the target page can include (1) HTML DOM nodes, (2) global JavaScript variables within the page, or even (3) private JavaScript variables within closures. In a nutshell, if you need some type of custom access to information with any QuickBase page the Be The API Technique allows you to gain access to it in a straightforward and consistent manner.

The technique works by first dynamically adding a hidden <iframe> to the host page (dashboard, user defined page, or a new, edit, view, report and grid edit page). The src attribute of the <iframe> is set to the URL of the page the information you wish to extract is located within. When the <iframe> finishes loading you simply reach into the <iframe> and access DOM nodes or JavaScript variables using special jQuery methods.

Here is a simple example of the Be The API Technique which extracts some information from QuickBase's Manage Users page and reformats it into a table displayed on the application's home page using Mustache.

Be The API
https://haversineconsulting.quickbase.com/db/bh3c5iqzf

This functionality is intended for an Administrator to use so I can't give everyone on the internet access to a working application. Instead please see the two screenshot attachments of (1) the normal administrative page for Manage Users and (2) the custom dashboard I created that extracts and displays on the dashboard some of the information from the Manage Users page. In this example I reach into the Manage Users page and grab an internal JavaScript variable (gManageUsers.view.collection.models) that happens to hold all the information I want access to. However, it is just as easy to access DOM nodes or parse the code with <script> tags to extract private JavaScript variables. This technique is perfectly general and is yet another reason why All Your QuickBase Are Belong To Us.

Here is the dashboard code:

Pastie
http://pastie.org/7725134

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=215

Finally, if you ware wondering about the novel bike image that adorns the application, it comes from the following patent which inspired me to name this new technique:

http://totallyabsurd.com/bethebike.htm

I got to get me one of those Be The Bike bikes.


Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb

Posted 6 years ago

  • 0
  • 1
Photo of Eliza

Eliza

  • 60 Points
Thanks Dan!
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
I am so glad my extreme hack of QuickBase pages gets the nod and approbation from the QuickBase forum moderator. I am marking your answer and the correct answer.