Kitewheel Graph API

The Kitewheel Graph API makes it easy to integrate Kitewheel business logic into other systems. This is achieved by providing a listener adaptor that can be added to any graph to make it publicly accessible. The graph is given a unique permanent URL that can be called immediately. 

The Kitewheel Graph API has three modes of operation: 

  • Standard API Listener - in this mode the graph exposes a web service end point that will respond to a web service POST request 
  • Web Tracking with the Kitewheel Web Tag - in this mode the graph provides some JavaScript that can be included on any web page to track activity and implement returned recommendations into the website
  • Pixel Tracking - in this mode the graph returns a 1x1 transparent image, implemented as an HTML page on a page. This can be used for email pixel tracking and simple web page tracking. 
    • Pixel with Cookie - this tag will handle and return a cookie to identify the user, along with the parameters specified on the pixel tag.
    • Pixel No Cookie - this tag will only return parameters and headers, no cookie is set. This can be used to track email open activity
  • Dynamic Content and Redirection - this mode can be used to return any valid HTTP response including a redirect to an image or another web page 

Adding a Graph API Listener

A graph API listener can be added by clicking on the Add Listener button in the top right of a graph editor screen.  Then select listener type "API"  from the drop down.

The Listener Id is a unique 32 character alpha-numeric string that identifies this listener. The same graph API listener on a different environment will have a different Listener Id.

The Kitewheel Graph API Listener can be edited at any time by clicking on the Edit Listener button  or by double clicking on the listener icon in the top left hand corner of the graph 

Kitewheel Graph API Header

All of the Kitewheel API requests return a standard "_kw" object as shown below as well as other information depending on the Graph API listener type. This object contains standard HTTP header fields. Descriptions courtesy of Wikipedia. 

	"_kw": {
		"headers": {
			"accept": "application/json, text/javascript, */*; q=0.01",
			"accept-encoding": "gzip, deflate, br",
			"accept-language": "en-US,en;q=0.8",
			"cache-control": "max-age=0",
			"content-length": "815",
			"content-type": "application/json; charset=UTF-8"
			"host": "",
			"origin": "",
			"referer": "",
			"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
			"x-forwarded-for": ",",
			"x-forwarded-port": "443",
			"x-forwarded-proto": "https",
			"x-real-ip": ""
acceptStringContent-Types that are acceptable for the response
accept-encodingStringList of acceptable encodings. See HTTP compression.
accept-languageStringList of acceptable human languages for response. See Content negotiation.
cache-controlStringUsed to specify directives that must be obeyed by all caching mechanisms along the request-response chain.
content-lengthStringThe length of the request body in octets (8-bit bytes).
content-typeStringThe MIME type of the body of the request (used with POST and PUT requests).
hostStringThe domain name of the Kitewheel server 
originStringInitiates a request for cross-origin resource sharing (asks server for an 'Access-Control-Allow-Origin' response field).
refererStringThis is the address of the previous web page from which a link to the currently requested page was followed. (The word “referrer” has been misspelled in the RFC as well as in most implementations to the point that it has become standard usage and is considered correct terminology)
user-agentStringThe user agent string of the user agent. If the request originated from a browser or other device. 
x-forwarded-forStringComma separated list of IP addresses involved in forwarding chain
x-forwarded-portStringAlways 443
x-forwarded-protoStringAlways https
x-real-ipStringThe IP address of the client who initiated the request