Skip to content
erebus1 edited this page Oct 3, 2015 · 8 revisions

all api use json format


Firstly you should add user, by calling addUser:

{'task': 'addUser', "data":{"userProfile": {'age':10, 'sex':'Male', 'hobbies':['dolphins','cats'], 'userType':{'type1':0.2,'type2':0.2,'type3':0.2,'type4':0.2,'type5':0.2,}}}}

PARAMETERS:

age - int

sex - Male/Female

hobbies - list of one-word-strings

userType - you should choose 5 types of user types and provide dict - list: 'typeX':float in range [0-1]

optional:

alreadyGifted - specify which items has been already gifted (list of strings)

As a result you will get userId, you should remember it.


Then you should make a list of predictions to this user by calling makeList:

{'task': 'makeList', "data":{"filter": {'minPrice':10, 'maxPrice':100}, "userId": user_id}}

PARAMETERS:

userId - id of user filter - here you can specify min and max price of gift - float value

Response

numberOfPages

After

You can call getSuggestions in order to get list of recommendations (100 items per page):

{'task': 'getSuggestions', "data":{"page":1, "userId": user_id}}

PARAMETERS

page - number of page you need

userId - id of User

You will ger error message, if page out of range or illegal userID

Response

you will get list of items data->items

and number of pages in suggestions list (be carefull, this number can varay (both increase and decrease while you rate items)) data->numberOfPages


and finaly you can rate items by calling rateItem:

{'task': 'rateItem', "data":{"itemId": "391093044791", "rating": 5, "userId": user_id}}

Parameters itemId - id of item, you can get it from items list

rating - int from in range [-5;5]

userIf - id of user

Response number of pages

Clone this wiki locally