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
- Pixel Tracking - in this mode the graph returns a 1x1 transparent image,
- 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
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.
"accept-encoding": "gzip, deflate, br",
"content-type": "application/json; charset=UTF-8"
"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": "184.108.40.206, 220.127.116.11",
|accept||String||Content-Types that are acceptable for the response|
|accept-encoding||String||List of acceptable encodings. See HTTP compression.|
|accept-language||String||List of acceptable human languages for response. See Content negotiation.|
|cache-control||String||Used to specify directives that must be obeyed by all caching mechanisms along the request-response chain.|
|content-length||String||The length of the request body in octets (8-bit bytes).|
|content-type||String||The MIME type of the body of the request (used with POST and PUT requests).|
|host||String||The domain name of the Kitewheel server |
|origin||String||Initiates a request for cross-origin resource sharing (asks server for an 'Access-Control-Allow-Origin' response field).|
|referer||String||This 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-agent||String||The user agent string of the user agent. If the request originated from a browser or other device. |
|x-forwarded-for||String||Comma separated list of IP addresses involved in forwarding chain|
|x-real-ip||String||The IP address of the client who initiated the request|