automating quickbase with api integration and itduzzit
TRANSCRIPT
Automating QuickBase with API Integration & itDuzzitOpening the outside world to QB using TWaaS solutions
Ty ShewmakeCTO, BrightLine CPAs, Inc.
Steve DeeseIntuit
#EMPOWER2015
① Why Bother with APIs in QB?
② The API – Shockingly Simple
③ The 4 Pieces of an API Call
④ Making QuickBase Talk (Old School)
⑤ TWaaS – itDuzzit (New School)
⑥ Data In & Out of QB - Step-by-Step
⑦ Review / Build Real World itDuzzit / QB Examples
AGENDA
#EMPOWER2015
Why Bother With APIs? –Ever Want To…
Run a process on all QB records every (x) minutes, hours, days…
Send notifications when a QB record reaches (x) minutes old…
Copy multiple records from QB table (a) to QB table (b)…
Copy records from/to app (x) from/to QB…
Sync records from/to app (x) from/to QB…
Verify email addresses in a QB record…
Determine distances in a QB record…
Add demographic info to QB records (gender, email, phone, twitter)…
Check if an email address already exists in a QB table…
#EMPOWER2015
Programmable Web Lists
more than 13,000 public APIs
There’s Something For
Everyone
Why Bother With APIs – The Benefits
www.programmableweb.com
#EMPOWER2015
Why Bother With APIs? – Examples (Demo)
Determine genders for QB contacts
Verify contact emails for QB contacts
Add company info to QB contacts
Add travel distances to QB contacts
Twilio – Call a contact from QB
Add a unique ID to a contact record
Some QuickBase examples…
QB DEMO
#EMPOWER2015
Many folks are intimidated by API jargon:
The API – Not Really So Scary…
API
XM
L
JSON
RE
QU
ES
T
RESPONSE
EN
DP
OIN
T
AUTHENTICATION
WEBHOOK ASYNC
#EMPOWER2015
www.gender-api.com – Nothing But A Browser:
https://gender-api.com/get?name=tyler&key=FwSeAtjvrMQlUtMAeQ
The API – A Bare-bones Demo
DEMO
#EMPOWER2015
We entered the REQUEST in the URL and got a RESPONSE in the
browser window.
The QB API Process – What happend?
Request (Tyler)
Response (male)
Ge
nd
er-A
PI.c
om
#EMPOWER2015
The API – “Application Programming Interface” (a big, scary word that means a standard way
that applications talk).
The QB API Process – Shockingly Simple
QuickBase APP “X”
Request (Tyler)
Write Record Response (male)
QB
AP
I
Ap
p “X
” AP
I
#EMPOWER2015
The Business Problem – Is Contact Male or Female?
How do we determine a
new contact’s gender when
a record is added to QB?
4 Pieces…
#EMPOWER2015
12
34Most API calls are
made up of just 4 parts
The Typical API CallEndpoint
Request
Authentication
Response
#EMPOWER2015
Most API calls start with a URL address or ENDPOINT…
Part 1 - The API Endpoint
https://gender-api.com/get
Endpoint
#EMPOWER2015
Part 2 - The API Request
https://gender-api.com/get?name=tyler
Endpoint Parameter(s)
APIs receive PARAMETERS appended to their ENDPOINT url…
#EMPOWER2015
https://gender-api.com/get?name=tyler&key=8tjuay721
Part 3 - API Authentication
Endpoint Parameter(s) Authentication
AUTHENTICATING to an API is usually easy…
#EMPOWER2015
Most APIs respond with text – as XML or JSON
① XML:
<name>tyler</name>
<gender>male</gender>
<accuracy>100</accuracy>
② JSON:
{"name":“tyler","gender":"male”,”samples”:”17847”,"accuracy":97“,”duration”:”
71ms”}
Part 4 - The Response
#EMPOWER2015
Steps – What Has To Happen in QB?
① Get QB to initiate the API call…
② The API does its thing (is contact male or female?)…
③Write response (“male”) back to the QB record
#EMPOWER2015
Old School – QB + Custom JavaScript Code
JavaScript(Code)
QuickBase
Web
Request
Response
APP “X”
QB
AP
I
Ap
p “X
” AP
I
#EMPOWER2015
The API request from QB must be “invoked” or triggered by something
Usually invoked by a QB URL button and a QB code page
Old School – QB + Custom JavaScript Code
//---------------------------------------------------------------------
var promise = $.get("main", {
act: "API_Authenticate",
username: “[email protected]",
password: “cxzxf771juq"
});
$.when(promise).then(function (xml) {
console.log(xml);
Q_ticket = $("ticket", xml).text();
//alert("Ticket Alert: " + Q_ticket);
GetTemplates();
});
//---------------------------------------------------------------------
function GetTemplates() {
var promise =
$.get("https://brightline.quickbase.com/db
/bppzxf4vj", {
act: "API_GetSchema",
ticket: Q_ticket,
apptoken:
"depks87dpjqxundrchzjy8mfrng"
});
Hits QB Code Page
#EMPOWER2015
Old School – QB + Custom JavaScript Code//----------------------------------------------------------------------------
var promise = $.get("main", {
act: "API_Authenticate",
username: “[email protected]",
password: “cxzxf771juq"
});
$.when(promise).then(function (xml) {
console.log(xml);
Q_ticket = $("ticket", xml).text();
//alert("Ticket Alert: " + Q_ticket);
GetTemplates();
});
//----------------------------------------------------------------------------
function GetTemplates() {
var promise = $.get("https://brightline.quickbase.com/db/bidzxf4vj", {
act: "API_GetSchema",
ticket: Q_ticket,
apptoken: "depks87dpjqxundrchzjy8mfrng"
});
$.when(promise).then(function (xml) {
console.log(xml);
//-----------------------------------------------------------------------------
function AddLinkRecord() {
var promise = $.get("https://brightline.quickbase.com/db/bid3jh9", {
act: "API_AddRecord",
ticket: Q_ticket,
apptoken: "depks87dpjqxlllundrchzjy8mfrng",
_fid_9: Q_i,
_fid_6: QBU_rid
});
$.when(promise).then(function (xml) {
console.log(xml);
Q_error = $("errdetail", xml).text();
Q_recid = $("rid", xml).text();
//alert("AddLink Error: " + Q_error);
});
}
//-----------------------------------------------------------------------------
function Finisher() {
url1 += "https://brightline.quickbase.com/db/bgr43us44";
url1 += "?a=dr";
url1 += "&rid=" + QBU_rid;
var promise = $.get("https://brightline.quickbase.com/db/bgr454364544
= Unfun//-----------------------------------------------------------------------------
function AddLinkRecord() {
var promise = $.get("https://
act: "API_AddRecord",
ticket: Q_ticket,
apptoken: "depks87dpjqxlllundrchzjy8mfrng",
_fid_9: Q_i,
_fid_6: QBU_rid
});
$.when(promise).then(function (xml) {
console.log(xml);
Q_error = $("errdetail", xml).text();
Q_recid = $("rid", xml).text();
//alert("AddLink Error: " + Q_error);
});
}
#EMPOWER2015
New “Low Code” Model – QB + “Tween-Ware”
QuickBase
Tyler Tyler
Gender
API
Ge
nd
er A
PI
QB
AP
I
MaleMale
#EMPOWER2015
TWaaS (Tween Ware as a Service) - API middleware
Inexpensive subscription service
Sits between QB and the world’s 13,000 (+) APIs
A way-station to transform data coming from/to QB
What is itDuzzit? TWaaS
#EMPOWER2015
“Duzzits” - Multi-step, low-code execution modules
2 Modes: Cloud-to-Cloud (easy) and Custom (advanced)
Hundreds of pre-built connectors
Duzzits can be scheduled to run every x minutes, days, weeks,
months
Duzzits can be invoked via emails (like QB notifications)
Duzzits can be invoked by the itDuzzit API
itDuzzit - Deconstructed
#EMPOWER2015
1. Get a FREE itDuzzit account (www.itduzzit.com)
2. Discover your QB endpoint & app token
3. Create a new Duzzit
4. Invoke your Duzzit from QB
5. Your Duzzit gets a QB ticket
6. Your Duzzit calls the desired API & receives response
7. Your Duzzit writes result back to QB record
QB & itDuzzit – Step-by-Step
7 Easy Steps…
#EMPOWER2015
https://brightline.quickbase.com/db/716uis9a8
Step 2 – Discover your QB Endpoint
Your QB Instance Name Your QB Table ID
QB Endpoint
#EMPOWER2015
• Each “Duzzit” has a unique MAILBOX & ENDPOINT:
MAILBOX: [email protected]
ENDPOINT: www.itduzzit.com/brightline.com/api/44716.xml?token=1234
Step 3 – Create a Duzzit
Endpoint Authentication
#EMPOWER2015
• Option 1 - Email notification - QB to itDuzzit mailbox (on add, edit, delete) or…
• Option 2 - Scheduled in itDuzzit (every X minutes, hours, days, weeks) or…
• Option 3 - Reusable QB URL Button (code below) that hits the Duzzit endpoint
Step 4 – Invoke the Duzzit From QB (Options)
var text baseurl = "https://www.itduzzit.com/ty.shewmake-brightline.com/api/44277.xml?token=1234567";
var text successmessage = "Verfiying Emails...";
"javascript:void($.ajax({type:'post',dataType:'jsonp',url:'" & $baseurl & "'}));" &
"javascript:alert('" & $successmessage & "');"
REUSABLE!
#EMPOWER2015
Step 5 –The Duzzit Requests a QB Ticket
UN & PW
QuickBase
aeb71jILo901waksj9LLoi
QB
AP
I
#EMPOWER2015
QuickBase also has EXCELLENT API documentation:
https://www.quickbase.com/api-guide/index.html
www.itDuzzit.com
Wrap-Up