Xponent Graph API
  • 03 Sep 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Xponent Graph API

  • Dark
    Light
  • PDF

Article summary

The Xponent Graph API makes integrating Xponent business logic into other systems easy. 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 Xponent Graph API has three modes of operation: 

  • Standard API Listener - in this mode, the graph exposes a web service endpoint that will respond to a web service POST request 
  • Web Tracking with the Xponent Journey Hub 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 and 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 dropdown.

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 Xponent 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.

Xponent Journey Hub Graph API Header

All of the Xponent API requests return a standard "_kw" object, as shown below, and 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": "api-demo.Xponent.com",
			"origin": "http://eudemo.Xponent.co.uk",
			"referer": "http://eudemo.Xponent.co.uk/retail/index.html",
			"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": "213.86.100.4, 213.86.100.4",
			"x-forwarded-port": "443",
			"x-forwarded-proto": "https",
			"x-real-ip": "213.86.100.4"
		}
	}
}
Attribute
Type
Description/Comment
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 good human languages for response. See Content negotiation.
cache-control
String
Used to specify directives that all caching mechanisms along the request-response chain must obey.
content-length
String
The length of the request body in octets (8-bit bytes).
content-type
String
The MIME type of the request's body (used with POST and PUT requests).
host
String
The domain name of the Xponent server 
origin
String
Initiates a request for cross-origin resource sharing (asks the 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 and 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 the forwarding chain
x-forwarded-port
String
Always 443
x-forwarded-proto
String
Always https
x-real-ip
String
The IP address of the client who initiated the request

Is it helpful? React and share your comment

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence