Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Integrating QuickBase with Web Services
Gareth Lewis, QuickBase User & Author of the QuickBase API Cookbook
2
1. You have a problem that can't be solved in the browser
with QuickBase or Javascript.
2. You have to use the QuickBase...
3
The SDK works with Ruby version 1.8.6 or higher.
It works with JRuby but not with IronRuby, yet.
Get Ruby: 1-Click insta...
4
Put Ruby code in a file with a .rb extension (e.g. authenticate.rb), and run it
by typing ruby authenticate.rb
authentic...
Twitter/
QuickBase
Integration
Generate
RSS feed
Send to
email in
html
format
Start Ruby
Script via
Web page
Ruby on
Smart...
require 'QuickBaseTwitterConnector' # Installed with SDK
QuickBase::TwitterConnector.new # Starts an interactive session
P...
7
Send HTML Emailrequire 'QuickBaseEmailer‘
def send_email( subject, message, bccRecipients )
emailBody = "Content-Type: t...
8
One RSS feed for multiple tables
require 'QuickBaseRSSGenerator'
qbc = QuickBase::Client.new( "username", "password" )
q...
9
Summary
QuickBase is great
There are a some things that can only be done
outside the browser, via the API
Ruby is not th...
Upcoming SlideShare
Loading in …5
×

Integrating QuickBase With Web Services - Gareth Lewis

f you have to use the QuickBase API outside the browser, one option is to access it via Ruby. Ruby is simple, flexible, powerful, easy to install and learn - and the Ruby SDK for QuickBase makes using the API straightforward. Through a series of concrete examples, we'll look at some SDK basics then go onto email, RSS, Twitter, web servers and other topics.

  • Be the first to comment

Integrating QuickBase With Web Services - Gareth Lewis

  1. 1. Integrating QuickBase with Web Services Gareth Lewis, QuickBase User & Author of the QuickBase API Cookbook
  2. 2. 2 1. You have a problem that can't be solved in the browser with QuickBase or Javascript. 2. You have to use the QuickBase API. 3. You want a simple language that just does what it's told and is friendly to work with. 4. You don't want to write a bunch of code just to get basic things accomplished. 5. If you don't like how the Ruby SDK does something, change the source code. Why use the Ruby SDK for QuickBase? Wrote Ruby SDK for QuickBase in 2005 to solve for project progress charting needs
  3. 3. 3 The SDK works with Ruby version 1.8.6 or higher. It works with JRuby but not with IronRuby, yet. Get Ruby: 1-Click installer for Windows: http://rubyforge.org/frs/download.php/47082/ruby186- 27_rc2.exe Get Ruby: Other O.S.: http://rubyforge.org/frs/?group_id=426&release_id=27644 Get JRuby: http://jruby.org/download Get the SDK from code.intuit.com QuickBase API CookBook: https://www.quickbase.com/db/bcdcajmrf Get Ruby and the SDK
  4. 4. 4 Put Ruby code in a file with a .rb extension (e.g. authenticate.rb), and run it by typing ruby authenticate.rb authenticate.rb: require 'QuickBaseClient' qbc = QuickBase::Client.new("username","password") qbc2 = QuickBase::Client.new; qbc2.authenticate("username","password") addRecord.rb: require 'QuickBaseClient' qbc = QuickBase::Client.new("username","password") recordId, update_id = qbc.addRecord("bcdcajmrf",{"Name" => "Fred"}) editRecord.rb: require 'QuickBaseClient‘ qbc = QuickBase::Client.new("username","password") qbc.editRecord("bcdcajmrf","1",{"Name" => "Fred"}) doQuery.rb: require 'QuickBaseClient' QuickBase::Client.new("username","password").doQuery("bcdcajmrg") { |record_xml| print record_xml} signOut.rb: require 'QuickBaseClient' qbc = QuickBase::Client.new("username","password") qbc.signOut Ruby SDK Basics
  5. 5. Twitter/ QuickBase Integration Generate RSS feed Send to email in html format Start Ruby Script via Web page Ruby on Smart Phones 5 Integration and Automation with Ruby Other examples using Ruby: • Ruby Scripts as Windows .EXE files • Search for records from a command-line • QuickBase + 'desktop' applications • Watir (Web application testing in Ruby) - Browser automation using Ruby • Rails Integration (Link to complete examples)
  6. 6. require 'QuickBaseTwitterConnector' # Installed with SDK QuickBase::TwitterConnector.new # Starts an interactive session Please enter the Quickbase username to use for this session: fred_flintstone@internet.com Please enter the Quickbase password to use for this session: wilma Please enter the Twitter username to use for this session: fred_flintstone Please enter the Twitter password to use for this session: wilma Please enter a number to select the connection type: 1 - Send Twitter messages to QuickBase. 2 - Send QuickBase messages to Twitter. 3 - Exchange messages between QuickBase and Twitter. 4 - Send automated replies from QuickBase to Twitter. 5 - All the above. 5 Getting 'friends' Twitter Status since Fri, 28 Mar 2008 13:47:24 -0700. Getting Direct Messages from Twitter since Fri, 28 Mar 2008 13:47:24 -0700. Sending messages from QuickBase to Twitter added since Fri, 28 Mar 2008 13:47:24 -0700. Getting Direct Messages from Twitter since Fri, 28 Mar 2008 13:47:24 -0700. Automated Direct Message sent to wilma_flintstone: what's for dinner?: rex ribs 6 Twitter Connector : background process polls QuickBase and Twitter for new records and tweets, sends data in both directions.
  7. 7. 7 Send HTML Emailrequire 'QuickBaseEmailer‘ def send_email( subject, message, bccRecipients ) emailBody = "Content-Type: text/html;nn" emailBody << "<HTML><BODY>" emailBody << message emailBody << "</BODY></HTML>" qbe = QuickBase::Emailer.new( "fred@bedrock.com", "wilma" ) qbe.sendBccEmail( "fred@bedrock.com", # from ["fred@bedrock.com", "wilma@bedrock.com"], # to bccRecipients, # BCC subject, emailBody, "mail.bedrock.com", # SMTP email server 25, # SMTP email port nil ) end qbc = QuickBase::Client.new( "fred@bedrock.com", "wilma" ) loop { qbc.iterateRecords( "bdcvpsxpy", [ "Record ID#", "subject", "message", "bccRecipients" ], nil, nil, "Pending Emails Report" ) { |record | send_email( record["subject"], record["message"], record["bccRecipients"].split(/,/) ) qbc.editRecord( "bdcvpsxpy", record["Record ID#"], { "sent" => "1" } ) # Exclude from Pending Emails Report } sleep( 5 ) # wait 5 minutes then check for more emails } Usage Case Scenario: Professional services tech team automates customer requests - Customer calls in a request - Employee enters request into QuickBase - Then calls/emails team to find a technician for the job - Now the process is entirely automated with the email script Saves 15 minutes per case…
  8. 8. 8 One RSS feed for multiple tables require 'QuickBaseRSSGenerator' qbc = QuickBase::Client.new( "username", "password" ) qbRSSgen = QuickBase::RSSGenerator.new( qbc ) qbRSSgen.setTitle( "QuickBase Forum/KnowledgeBase RSS" ) qbRSSgen.setLink( "main" ) qbRSSgen.setDescription( "RSS view of QuickBase Community Forum and KnowledgeBase" ) qbRSSgen.addTable("8emtadvk", "Community Forum", { "title" => "6", "description" => "10" }, # Field IDs nil, nil, "List Changes", 75 ) # 75 records qbRSSgen.addTable( "6mztyxu8", "KnowledgeBase", { "title" => "5", "description" => "6" }, "{'6'.CT.'API'}", # API KnowledgeBase entries nil, nil, 50 ) # 50 records rssText = qbRSSgen.generateRSStext File.open( "QuickBaseInfoRSS.xml", "w" ) { |file| file.write( rssText ) } # upload to QuickBase ?!
  9. 9. 9 Summary QuickBase is great There are a some things that can only be done outside the browser, via the API Ruby is not the answer to Life, the Universe and Everything Ruby will not waste your time Ruby is a very pleasant language with tons of excellent libraries The Ruby SDK aims to help you get QuickBase API work done quickly, even if you've never used Ruby The examples in this presentation show some of what can be done, and how to do it See you in the QuickBase Innovation Network !

    Be the first to comment

    Login to see the comments

  • kanylin

    Feb. 21, 2011

f you have to use the QuickBase API outside the browser, one option is to access it via Ruby. Ruby is simple, flexible, powerful, easy to install and learn - and the Ruby SDK for QuickBase makes using the API straightforward. Through a series of concrete examples, we'll look at some SDK basics then go onto email, RSS, Twitter, web servers and other topics.

Views

Total views

6,392

On Slideshare

0

From embeds

0

Number of embeds

691

Actions

Downloads

61

Shares

0

Comments

0

Likes

1

×