recommender_api

Mobiplus Recommender API

We have 2 ways available to interface with the Mobiplus Recommendation Engine

API Mode

Download data from recommendation API:

  • recommendation.js file should be added to the website.
  • With the above API we can get Recommendations by giving parameters the id of the customer or the id of one or more products.
  • Also for the Recommendation Engine to work properly we need to send some basic data in every transaction.
  • Below are examples of the above functions.

Parameters of the following functions are the client's userid and the token which we provide. In case we don't know the customer because they haven't signed in then we call the following function with NULL userid.


Receive data in JSON format

get_user_items_json(userid,token);


Receive data in HTM format

get_user_items_html(userid,token);




Parameters of the following functions are the code of the product(s). In case we have more than 1 product, then the List should be a string with the ids of the products separated by a comma “,”, e.g.

list=108,109,150,286;


The token parameter is a string which we give you.


Receive data in JSON format

get_history_items_json(list,token);


Receive data in HTM format

get_history_items_html(list,token);




Sending data during the transaction of a customer who has signed in or unknown.
In this case we call the function:

item_click(userid,itemid,clicktype,sessionid,token);


ParameterInformation
useridYour customer's password (blank if they have not signed in).
itemidProduct code.
clicktypeA string with one of two values (basket, favorite).
basketThe price is given when the product is added to the shopping cart,
favoriteGiven in case it has been added to the wish list.
SessionidIt is the code of the session currently created for your customer




Operation Rest Web Service

By calling the REST Web Service with the corresponding parameters we have the following possibilities:
The values of the parameters: clientid, projectid, date, will be given by us.

Required for calling the other WebServices

/clienttoken?client_id= clientid&project_id= projectid&exp_date=date



/reco?itemsid= itemsid&userid= userid&sessionid=sessionid&token= token


ParameterInformation
itemsidIn case of more than one product id there should be a “,” comma separating the ids. E.g. itemsid = 108 or itemsid= 108,109,250,456
useridThe parameter is the id of the registered user.
sessionidThe sessionid parameter is the sessionid that your client is currently using.
tokenThe parameter can be retrieved using the previous WS “clienttoken”.

The itemsid and userid parameters can also be NULL.

The sessionid and clienttoken parameters are mandatory.



Every time the customer clicks on a product then you should call the WS below giving the corresponding reason for clicking on a product.

/clickinsert?userid= userid&itemid=itemid&clicktype=clicktype&sessionid=sessionid&token=token


ParameterInformation
useridThe parameter is the id of the registered user.
itemidThe parameter is the id of the product.
clicktypeThe parameter is the reason for clicking and can be one of the following values: clicktype = click or favorite or wishlist or basket

The sessionid parameter is the sessionid your client is currently using.

The token parameter can be retrieved using the previous WS “clienttoken”.

Only the userid parameter can be empty.

All other parameters are mandatory.



/saleinsert?itemid=itemid&userid=userid&sessionid=sessionid&purchaseprice=purchaseprice&name=name&timestamp=timestamp&token=token


ParameterInformation
itemidThe parameter is the id of the product.
useridThe parameter is the id of the registered user.
sessionidThe parameter is the sessionid, which your customer is currently using.
purchasepriceThe parameter is the price of the product.
nameThe parameter is the name of the product.
timestampThe parameter is the timestamp of the purchase. E.g. “2021-3-22 19:30:10”.
tokenThe parameter can be retrieved using the previous WS “clienttoken”.

All other parameters are mandatory.