Getting Started

Introduction

The Qfuse API is a basic RESTful API which takes a few key parameters, the most important of which is the Salesforce ID passed and used to pull up the associated Qfuse site/qr data associated with that salesforce id. The response can be sent back in JSON or XML format--whichever is preferred for integration.

The analytics data exposed via the Qfuse API is read-only and explicitly related to the Qfuse site(s)/code(s) in an account. There are three sets of Qfuse data which can be exposed, based on the API call (aka the "get-" / "fetch-request"):

Based on the call itself, the data returned will be for one or many sites--depending on how many sites/codes are associated with the passed Salesforce ID. See the data schemas below for more info.

Authentication

The API uses digest authentication. These should be passed via GET variables "api_key" and "password" in the RESTful call to the API. No data will be returned if these two variables are not sent.



Methods / Requests

Fetch QR Scans Data

GET https://api.qfuse.com/site?id=::salesforce_id::&format=::format::&api_key=::api_key::&password=::password::&fetch=qr_code_scans

Fetch Site Tracking Data

GET https://api.qfuse.com/site?id=::salesforce_id::&format=::format::&api_key=::api_key::&password=::password::&fetch=site_tracking

Fetch Site Settings Data

GET https://api.qfuse.com/site?id=::salesforce_id::&format=::format::&api_key=::api_key::&password=::password::&fetch=site

Fetch Mobile Contact Form Submissions

GET https://api.qfuse.com/site?id=::salesforce_id::&format=::format::&api_key=::api_key::&password=::password::&fetch=contact_form_submissions

Request Parameters:

The following paramaters must be passed, as defined below:

Example URL:
GET https://api.qfuse.com/site?id=001E000000JMAdr&format=xml&api_key=aa4561214538b4ad181d8952e3f97833&password=butterflies66&fetch=qr_code_scans

Responses:

Response for qr_code_scans fetch:

{
    "id": 20638,
    "site_id": 2638,
    "ip_address": "74.82.64.161",
    "user_agent": "Mozilla/5.0 (BlackBerry; U; BlackBerry 9810; en-US) AppleWebKit/534.11+",
    "time": 2012-08-07 13:05:45,
    "host_address": "74-82-64-161.rdns.blackberry.net",
    "browser": "BlackBerry",
    "version": "v2.2",
    "operating_system": "BlackBerry",
    "country": "United States",
    "region": "Vermont",
    "city": "Burlington",
    "zip_code": "05401",
    "latitude": "38",
    "longitude": "-97"
}

Response for site_tracking fetch:

{
    "id": 110224,
    "datetime": 2012-08-07 13:05:46,
    "type": "event",
    "site_id": 2638,
    "ip": "74.82.64.160",
    "page": "/s/qfuse/camp-wagalot",
    "page_title": "Landing Page / Homepage",
    "viewport": "320x358",
    "browser": "Safari",
    "browser_version": "534.11",
    "device": "BlackBerry",
    "platform": "BlackBerry",
    "user_agent": "Mozilla/5.0 (BlackBerry; U; BlackBerry 9810; en-US)",
    "category": "Button",
    "label": "Google Local"
    "value": "https://qfuse.com/s/qfuse/google-instructions"
}

Response for site fetch:

{
    "id": 110224,
    "user_id": 361,
    "tracking_id": "1S7W",
    "title": "Camp Wagalot",
    "footer": "Copyright 2012",
    "url_string": "camp-wagalot",
    "external_url_string": "https://www.google.com",
    "image": "qfuse_15e43ba33ea50dd194b1576e4f7516d7.png",
    "expand_image": 1,
    "header_image_options": 0,
    "palette_id": 0,
    "custom_styles": 1,
    "creation_date": "2012-07-24 10:20:13",
    "modified_date": "2012-07-24 10:20:13",
    "isExternal": 0,
    "password_protected": 0
    "password": "cheesecake37"
    "salesforce_id": "001E000000JMAdr"
}

Response for contact_form_submissions fetch:

{
    "id": 110224,
    "date_submitted": "2014-07-24 10:20:13",
    "site_id": 3322,
    "page_url": https://qfuse.com/s/qfuse/contact-us,
    "json_data": {"to":"info@qfuse.com","subject":"Qfuse Mobile Site - Contact Us","Name_first_and_last":"Sean Dempsey","Phone_Number":"6035559493","Email_Address":"sean@qfuse.com","State":"IL","City":"Milton","Message":"Can I please get a bit of info on this product?","site_id":"3322"},
    "visitor_data": "Mozilla/5.0 (Linux; U; Android 4.1.1; en-us; NX008HD8G Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30",
    "ip_address": "192.168.0.1",
}

Error Responses

Errors are possible under the following circumstances:

Error messages will be returned under the following format:

{
    "error": "A Salesforce ID was not specified"
}

Qfuse Table Schemas (Data Legends)

qr_code_scans:

TABLE `qr_code_scans` (
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `site_id` int(11) NOT NULL,
  `ip_address` varchar(39) COLLATE utf8_unicode_ci NOT NULL,
  `user_agent` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `host_address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `browser` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `version` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `operating_system` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `country` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `region` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `zip_code` char(5) COLLATE utf8_unicode_ci DEFAULT NULL,
  `latitude` float DEFAULT NULL,
  `longitude` float DEFAULT NULL,
  PRIMARY KEY  (`id`)
);

site_tracking:

TABLE `site_tracking` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `datetime` datetime NOT NULL,
  `type` varchar(8) CHARACTER SET latin1 NOT NULL,
  `site_id` int(11) NOT NULL,
  `ip` varchar(128) CHARACTER SET latin1 NOT NULL,
  `page` varchar(255) CHARACTER SET latin1 NOT NULL,
  `viewport` varchar(30) CHARACTER SET latin1 NOT NULL,
  `browser` varchar(50) CHARACTER SET latin1 NOT NULL,
  `browser_version` varchar(20) CHARACTER SET latin1 NOT NULL,
  `device` varchar(100) COLLATE utf8_bin DEFAULT NULL,
  `platform` varchar(100) COLLATE utf8_bin DEFAULT NULL,
  `user_agent` varchar(255) CHARACTER SET latin1 NOT NULL,
  `referrer` varchar(255) CHARACTER SET latin1 NOT NULL,
  `skin` int(11) NOT NULL,
  `category` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  `label` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  `value` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY  (`id`)
);

sites:

TABLE `sites`(
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `tracking_id` varchar(4) collate utf8_unicode_ci NOT NULL,
  `title` varchar(255) collate utf8_unicode_ci NOT NULL,
  `footer` text collate utf8_unicode_ci NOT NULL,
  `url_string` varchar(255) collate utf8_unicode_ci NOT NULL,
  `external_url_string` varchar(255) collate utf8_unicode_ci default NULL,
  `image` varchar(255) collate utf8_unicode_ci default NULL,
  `expand_image` tinyint(1) NOT NULL,
  `header_image_options` tinyint(1) NOT NULL,
  `palette_id` varchar(3) collate utf8_unicode_ci NOT NULL,
  `custom_styles` tinyint(4) NOT NULL default '0',
  `main_site` tinyint(1) NOT NULL,
  `creation_date` datetime NOT NULL,
  `modified_date` datetime NOT NULL,
  `isExternal` tinyint(4) NOT NULL,
  `password_protected` tinyint(4) NOT NULL,
  `password` varchar(255) collate utf8_unicode_ci default NULL,
  `salesforce_id` varchar(25) collate utf8_unicode_ci default NULL,
  PRIMARY KEY  (`id`)
);

mobile_contact_form_submissions:

TABLE `contact_form_submissions` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `date_submitted` datetime NOT NULL,
  `site_id` int(11) DEFAULT NULL,
  `site_title` VARCHAR(255) DEFAULT NULL,
  `page_url` varchar(128) DEFAULT NULL,
  `json_data` mediumtext NOT NULL,
  `visitor_data` text NOT NULL,
  `ip_address` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`)
);

Notes

If you have any questions, please email sean at qfuse dot com.

Copyright © 2012 Quick Fuse Media, LLC.