Using API for SpaBoom to Integrate Into Your Website

Introduction

Instant Gift Certificates can be integrated into your existing website as simply as adding a link from your main page.  For more advanced users, it can be customized with just a few extra steps to blend in to the look of your current site.

To do this, SpaBoom has prepared an API that enables your website to insert SpaBoom functionality directly into your web pages. This document shows you how to utilize and take advantage of the SpaBoom API.

Configuring your BoomTime API

  1. If you haven't already done so (or your web hosting company hasn't done it for you), Download API Client.
  2. Unzip the files to somewhere on your local computer where you can find them - the Desktop is a good place for this.
  3. You should now have a folder labeled "boomtime" in the location where you extracted the files.

    Inside this folder you should have five files. They are:

    boomtime_client.php BoomTime function calls. This file is needed when calling BoomTime functionality.
    default.css Sample markup to support the look-and-feel in instant_gift_certificate.php. Make changes here to update how instant_gift_certificate.php looks, if you want to use this file instead of build your own from a blank page in your website.
    example.php An example page, which is very basic and a great place to start if you want to see how the API calls work.
    index.php A simple redirect to instant_gift_certificate.php.
    instant_gift_certificate.php A sample Instant Gift Certificate page, that is meant to look somewhat decent, using the logo we have on file for you, and referencing the CSS located in default.css. Feel free to change this file, and the default.css to suite your tastes, if you don't want to paste the API function calls into your own blank page.
  4. Open both example.php and instant_gift_certificate.php in a text editor like WordPad or Notepad (avoid using word processing programs like Microsoft Word).
  5. In each, locate the line:
    $BT_Client = new BoomTime_Client('', '');
  6. Between the single quotes replace the "" with "YOUR-SPABOOM-ID" (this was chosen by you when you signed up for your BoomTime account).
  7. Configuring BoomTime to use your SSL certificate:
    • If you are using a dedicated SSL certificate, which means you can reach your website securely by typing in https://www.yourwebsite.com, then you simply need to replace the "" between the single quotes with "www.yourwebsite.com".
    • However, if you are using shared SSL certificate (example: secure.myhost.com/username) then you will need to change to contain the location of your shared cert:
      BoomTime_Client($BT_Client = new BoomTime_Client('your-spaboom-id', 'secure.myhost.com/username');
  8. Save the changes you've made to your example.php and instant_gift_certificate.php files.
  9. Open your FTP program and connect to your website.
  10. On your website, create a new folder called "spaboom" somewhere from the root (or top level) directory. Upload all five files into that folder. (If prompted, upload the files in "ASCII" format.)
  11. Now make a quick test to make sure that all your settings are correct. Open your web browser and browse to the example.php file. If you have placed it in the folder listed above, the URL should look like "http://www.yourwebsite.com/spaboom/example.php".
  12. If you see a page that displays "Instant Gift Certificates" below the BoomTime API information, congratulations, you've setup everything correctly! If not, reference our Troubleshooting Guide for help some ideas on how to fix things.

So, my BoomTime API is working. Now what?

  • Do you want to have SpaBoom Instant Gift Certificates match the look-and-feel of your website? If so, please read our guide for Mimicking Your Website.
  • Link to your new Instant Gift Certificate page on your website. Our Link Placement Guide has tips and suggestions on how and where to do this, to help maximize your sales!
  • Upload your logo to SpaBoom, so your Instant Gift Certificates look professional and represent your brand.
  • Not looking just right? Check out our Web Services Troubleshooting Guide, and all else failing, you might want to consider using Custom CSS to fine-tune how your page looks.
  • Finally, if you need help, we're willing to do all of this for you for a fee. See Getting Customized Integration Support for more information.