Seldon JavaScript API

The Seldon JavaScript API provides the simplest method of integrating Seldon onto web based services. It provides the following methods:

For details on the overall concepts of users, items and actions see the Oauth API

User Action

GET     /js/actions

Input

Example

http://<HOST>/js/action/new?consumer_key=XYZ&user=1&item=2&type=1&jsonpCallback=j
{
	"actionId":null,
	"user":"1",
	"item":"2",
	"type":1,
	"date":1421336333669,
	"value":0.0,
	"times":1,
	"comment":null,
	"tags":null,
	"recTag":null,
	"referrer":null
}

User Recommendations

GET     /js/recommendations

Input

Example

http://<HOST>/js/recommendations?consumer_key=XYZ&user=1&limit=3&attributes=title&jsonpCallback=j
j({
	"size":3,
	"requested":3,
	"list":[
		{
		"id":"500",
		"name":"Mrs. Doubtfire (1993)",
		"type":1,
		"first_action":1421080898000,
		"last_action":1421080898000,
		"demographics":[],"attributes":{"12":616,"1":1,"11":582},
		"attributesName":{"title":"Mrs. Doubtfire (1993)","recommendationUuid":"3"}},
		{"id":"586",
		"name":"Home Alone (1990)",
		"type":1,
		"first_action":1421080898000,
		"last_action":1421080898000,
		"demographics":[],
		"attributes":{"12":542,"1":1,"11":541},
		"attributesName":{"title":"Home Alone (1990)","recommendationUuid":"3"}},
		{"id":"153",
		"name":"Batman Forever (1995)",
		"type":1,
		"first_action":1421080898000,
		"last_action":1421080898000,
		"demographics":[],
		"attributes":{"1":1,"11":1,"12":2,"13":35,"14":36},
		"attributesName":{"title":"Batman Forever (1995)","recommendationUuid":"3"}}
		]
})