Menu

ActionAPI

Stephan Zavrel

view

Sample call

HTTP GET

{yourServerURL}/api/1.1/view?apikey=8ab9dc3ffcdac576d0f298043a60517a&tenantid=EASYREC_DEMO&itemid=42&itemdescription=Fatboy%20Slim%20-%20The%20Rockafeller%20Skank&itemurl=/item/fatboyslim&itemimageurl=/img/covers/fatboyslim.jpg&userid=24EH1723322222A3&sessionid=F3D4E3BE31EE3FA069F5434DB7EC2E34&actiontime=01_01_2009_23_59_59&itemtype=ITEM

Parameters

parameter occurence description
apikey required API Key to access this service.(e.g. "8ab9dc3ffcdac576d0f298043a60517a")
tenantid required tenant id to identify your Website. (e.g. "EASYREC_DEMO")
sessionid required session id of a user. (e.g. "F3D4E3BE31EE3FA069F5434DB7EC2E34")
itemid required id to identify an item on your Website. (e.g. "ID001")
itemdescription required item description that is displayed when showing recommendations on your Website. (e.g. "the frog")
itemurl required url that links to the item page on your Website.
Note:Please encode &'s in url with %26
userid optional An optional anonymised id of a user. (e.g. "24EH1723322222A3")
itemimageurl optional An optional item image url that links to a image of the item.
Note:Please encode &'s in url with %26
actiontime optional; default: the current system time An optional action time parameter that overwrites the current timestamp of the action. The parameter has the format "dd_MM_yyyy_HH_mm_ss" (e.g."01_01_2009_23_59_59").
itemtype optional; default:ITEM An optional item type that denotes the type of the item (e.g. IMAGE, VIDEO, BOOK, etc.). If not supplied the default value ITEM will be used.
actioninfo optional an arbitraray valid JSON object with additional information about he action. The JSON string may be up to 500 characters long.

buy

Sample call

HTTP GET

{yourServerURL}/api/1.1/buy?apikey=8ab9dc3ffcdac576d0f298043a60517a&tenantid=EASYREC_DEMO&itemid=42&itemdescription=Fatboy%20Slim%20-%20The%20Rockafeller%20Skank&itemurl=/item/fatboyslim&itemimageurl=/img/covers/fatboyslim.jpg&userid=24EH1723322222A3&sessionid=F3D4E3BE31EE3FA069F5434DB7EC2E34&actiontime=01_01_2009_23_59_59&itemtype=ITEM

Parameters

parameter occurence description
apikey required API Key to access this service.(e.g. "8ab9dc3ffcdac576d0f298043a60517a")
tenantid required tenant id to identify your Website. (e.g. "EASYREC_DEMO")
sessionid required session id of a user. (e.g. "F3D4E3BE31EE3FA069F5434DB7EC2E34")
itemid required id to identify an item on your Website. (e.g. "ID001")
itemdescription required item description that is displayed when showing recommendations on your Website. (e.g. "the frog")
itemurl required url that links to the item page on your Website.
Note:Please encode &'s in url with %26
userid optional An optional anonymised id of a user. (e.g. "24EH1723322222A3")
itemimageurl optional An optional item image url that links to a image of the item.
Note:Please encode &'s in url with %26
actiontime optional; default: the current system time An optional action time parameter that overwrites the current timestamp of the action. The parameter has the format "dd_MM_yyyy_HH_mm_ss" (e.g."01_01_2009_23_59_59").
itemtype optional; default:ITEM An optional item type that denotes the type of the item (e.g. IMAGE, VIDEO, BOOK, etc.). If not supplied the default value ITEM will be used.
actioninfo optional an arbitraray valid JSON object with additional information about he action. The JSON string may be up to 500 characters long.

rate

Sample call

HTTP GET

{yourServerURL}/api/1.1/rate?apikey=8ab9dc3ffcdac576d0f298043a60517a&tenantid=EASYREC_DEMO&itemid=42&itemdescription=Fatboy%20Slim%20-%20The%20Rockafeller%20Skank&itemurl=/item/fatboyslim&itemimageurl=/img/covers/fatboyslim.jpg&userid=24EH1723322222A3&sessionid=F3D4E3BE31EE3FA069F5434DB7EC2E34&ratingvalue=8&actiontime=01_01_2009_23_59_59&itemtype=ITEM

Parameters

parameter occurrence description
apikey required API Key to access this service.(e.g. "8ab9dc3ffcdac576d0f298043a60517a")
tenantid required tenant id to identify your Website. (e.g. "EASYREC_DEMO")
sessionid required session id of a user. (e.g. "F3D4E3BE31EE3FA069F5434DB7EC2E34")
itemid required id to identify an item on your Website. (e.g. "ID001")
itemdescription required item description that is displayed when showing recommendations on your Website. (e.g. "the frog")
itemurl required url that links to the item page on your Website.
Note:Please encode &'s in url with %26
userid optional An optional anonymised id of a user. (e.g. "24EH1723322222A3")
itemimageurl optional An optional item image url that links to a image of the item.
Note:Please encode &'s in url with %26
ratingvalue required A required rating value for the item. The value must be an integer in the range from 1 to 10 (e.g. 5)
actiontime optional; default: the current system time An optional action time parameter that overwrites the current timestamp of the action. The parameter has the format "dd_MM_yyyy_HH_mm_ss" (e.g."01_01_2009_23_59_59").
itemtype optional; default:ITEM An optional item type that denotes the type of the item (e.g. IMAGE, VIDEO, BOOK, etc.). If not supplied the default value ITEM will be used.
actioninfo optional an arbitraray valid JSON object with additional information about he action. The JSON string may be up to 500 characters long.

sendaction

While the view, buy and rate calls are tailored towards a typical eCommerce shop application, easyrec allows for the definition of arbitrary new action types as required by the specific use case. You can use the generic sendaction API call to send actions of any type to easyrec. Use the actiontype parameter to specify the action. Note: action types must be created using the Admin GUI prior to being accepted as valid API calls.

Sample call

HTTP GET

{yourServerURL}/api/1.1/sendaction?apikey=8ab9dc3ffcdac576d0f298043a60517a&tenantid=EASYREC_DEMO&actiontype=PUT_INTO_SHOPPINGCART&itemid=42&itemdescription=Fatboy Slim%20-%20The%20Rockafeller%20Skank&itemurl=/item/fatboyslim&itemimageurl=/img/covers/fatboyslim.jpg&userid=24EH1723322222A3&sessionid=F3D4E3BE31EE3FA069F5434DB7EC2E34&actiontime=01_01_2009_23_59_59&itemtype=ITEM

Parameters

parameter occurence description
apikey required API Key to access this service.(e.g. "8ab9dc3ffcdac576d0f298043a60517a")
tenantid required tenant id to identify your Website. (e.g. "EASYREC_DEMO")
sessionid required session id of a user. (e.g. "F3D4E3BE31EE3FA069F5434DB7EC2E34")
itemid required id to identify an item on your Website. (e.g. "ID001")
itemdescription required item description that is displayed when showing recommendations on your Website. (e.g. "the frog")
itemurl required url that links to the item page on your Website.
Note:Please encode &'s in url with %26
userid optional An optional anonymised id of a user. (e.g. "24EH1723322222A3")
itemimageurl optional An optional item image url that links to a image of the item.
Note:Please encode &'s in url with %26
actiontype required the actiontype of the action you want to send. You have to creation actiontypes using the admin GUI before you can use it in API calls.
actionvalue optional If your actiontype uses actionvalues this parameter is required. It is used to save the actionvalue of your action.
actiontime optional; default: the current system time An optional action time parameter that overwrites the current timestamp of the action. The parameter has the format "dd_MM_yyyy_HH_mm_ss" (e.g."01_01_2009_23_59_59").
itemtype optional; default:ITEM An optional item type that denotes the type of the item (e.g. IMAGE, VIDEO, BOOK, etc.). If not supplied the default value ITEM will be used.
actioninfo optional an arbitraray valid JSON object with additional information about he action. The JSON string may be up to 500 characters long.

track

The track action can be used to track clicks on recommendations. It should be called when a user clicks on a recommended item. This way it can be tracked if the recommendations shown to users are appreciated.

Sample call

HTTP GET

{yourServerURL}/api/1.1/json/track?apikey=8ab9dc3ffcdac576d0f298043a60517a&tenantid=EASYREC_DEMO&itemfromid=42&itemfromtype=ITEM&itemtoid=43&itemtotype=ITEM&sessionid=F3D4E3BE31EE3FA069F5434DB7EC2E34&rectype=VIEWED_TOGETHER

Parameters

parameter occurrence description
apikey required API Key to access this service.(e.g. "8ab9dc3ffcdac576d0f298043a60517a")
tenantid required tenant id to identify your Website. (e.g. "EASYREC_DEMO")
sessionid required session id of a user. (e.g. "F3D4E3BE31EE3FA069F5434DB7EC2E34")
itemfromid optional id to identify the item currently displayed on your website. (e.g. "ID001") In case there is no specific item displayed on the page (e.g. an overview page where you display rankings) this parameter can be left out.
itemfromtype optional; default:ITEM An optional item type that denotes the type of the item (e.g. IMAGE, VIDEO, BOOK, etc.). If not supplied the default value ITEM will be used.
itemtoid required the id of the recommended item that was clicked on
itemtotype optional; default:ITEM An optional item type that denotes the type of the item (e.g. IMAGE, VIDEO, BOOK, etc.). If not supplied the default value ITEM will be used.
rectype required either the association type that was used to display the recommendation (e.g. VIEWED_TOGETHER) or one of the following values: RECS_FOR_USER in case the recommended item came from the recommendationsforuser call; RANKING in case the recommended item came from a ranking call (e.g. mostvieweditems); CLUSTER in case the recommended item came from a ranking call (e.g. itemsofcluster); HISTORY in case the recommended item came from the actionhistoryforuser call.
userid optional An optional anonymised id of a user. (e.g. "24EH1723322222A3")

Related

Wiki: API

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.