Developer Section


Salesman speaks Javascript and REST to fetch customers' activities and to produce personalized recommendations/promotions.

Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


Include the following script into your HTML layout:

<script src='http://salesman.badrit.com/api.js'></script>

<script type='text/javascript'>
var salesman = new BadrSalesmanRecommender('ACCESS_TOKEN', {'user_id': 'USER_ID', 'item_id': 'ITEM_CATALOG_ID', 'recommendations_size': 10});
</script>

  • user_id , item_id and recommendations_size are optional parameters.
  • If user_id is not passed, a user cookie ID will be used by default.
  • If item_id is passed, salesman will recommend products only related to this product.


Then add a div with ID badrSalesmanHomeRecommendation in your HTML page.

<div id='badrSalesmanHomeRecommendation'></div>

Now, enjoy the expert salesman recommendations inside this div container.

Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


To fetch user recommended products, use the following REST API.

curl --include \ 'http://salesman.badrit.com/api/v1/recommendations/get_recommendation.json?access_token=ACCESS_TOKEN&user_id=USER_ID&item_id=ITEM_CATALOG_ID&recommendations_size=10'

  • user_id , item_id and recommendations_size are optional parameters.
  • If item_id is passed, salesman will recommend products only related to this product.
  • Now, enjoy the expert salesman recommendations.


Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


Include the following script into your HTML layout:

<script src='http://salesman.badrit.com/api.js'></script>

<script type='text/javascript'>
var salesman = new BadrSalesmanRecommender('ACCESS_TOKEN', {'user_id': 'USER_ID', 'item_id': 'ITEM_CATALOG_ID', 'recommendations_size': 10});
</script>

  • user_id , item_id and recommendations_size are optional parameters.
  • If user_id is not passed, a user cookie ID will be used by default.
  • If item_id is passed, salesman will recommend products only related to this product.


Then add a div with ID badrSalesmanProductRecommendation in your HTML page.

<div id='badrSalesmanProductRecommendation'></div>

Now, enjoy the expert salesman recommendations inside this div container.

Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


To fetch user recommended products, use the following REST API.

curl --include \ 'http://salesman.badrit.com/api/v1/recommendations/get_recommendation.json?access_token=ACCESS_TOKEN&user_id=USER_ID&item_id=ITEM_CATALOG_ID&recommendations_size=10'

  • user_id , item_id and recommendations_size are optional parameters.
  • If item_id is passed, salesman will recommend products only related to this product.


Now, enjoy the expert salesman recommendations.

Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


Include the following script into your HTML layout:

<script src='http://salesman.badrit.com/api.js'></script>

<script type='text/javascript'>
var salesman = new BadrSalesmanRecommender('ACCESS_TOKEN', {'user_id': 'USER_ID', 'item_id': 'ITEM_CATALOG_ID', 'recommendations_size': 10});
</script>

  • user_id , item_id and recommendations_size are optional parameters.
  • If user_id is not passed, a user cookie ID will be used by default.
  • If item_id is passed, salesman will recommend products only related to this product.


Then add a div with ID badrSalesmanRecent in your HTML page.

<div id='badrSalesmanRecent'></div>

Now, enjoy the expert salesman recommendations inside this div container.

Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


To fetch user recommended products, use the following REST API.

curl --include \ 'http://salesman.badrit.com/api/v1/recommendations/get_recommendation.json?access_token=ACCESS_TOKEN&user_id=USER_ID&item_id=ITEM_CATALOG_ID&recommendations_size=10'

  • user_id , item_id and recommendations_size are optional parameters.
  • If item_id is passed, salesman will recommend products only related to this product.


Now, enjoy the expert salesman recommendations.

Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


Include the following script into your HTML layout:

<script src='http://salesman.badrit.com/api.js'></script>

<script type='text/javascript'>
var salesman = new BadrSalesmanRecommender('ACCESS_TOKEN', {'user_id': 'USER_ID', 'item_id': 'ITEM_CATALOG_ID', 'recommendations_size': 10});
</script>

  • user_id , item_id and recommendations_size are optional parameters.
  • If user_id is not passed, a user cookie ID will be used by default.
  • If item_id is passed, salesman will recommend products only related to this product.


Then add a div with ID badrSalesmanTopSold in your HTML page.

<div id='badrSalesmanTopSold'></div>

Now, enjoy the expert salesman recommendations inside this div container.

Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


To fetch user recommended products, use the following REST API.

curl --include \ 'http://salesman.badrit.com/api/v1/recommendations/get_recommendation.json?access_token=ACCESS_TOKEN&user_id=USER_ID&item_id=ITEM_CATALOG_ID&recommendations_size=10'

  • user_id , item_id and recommendations_size are optional parameters.
  • If item_id is passed, salesman will recommend products only related to this product.


Now, enjoy the expert salesman recommendations.

Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


Include the following script into your HTML layout:

<script src='http://salesman.badrit.com/api.js'></script>

<script type='text/javascript'>
var salesman = new BadrSalesmanRecommender('ACCESS_TOKEN', {'user_id': 'USER_ID', 'item_id': 'ITEM_CATALOG_ID', 'recommendations_size': 10});
</script>

  • user_id , item_id and recommendations_size are optional parameters.
  • If user_id is not passed, a user cookie ID will be used by default.
  • If item_id is passed, salesman will recommend products only related to this product.


Then add a div with ID badrSalesmanTopViewed in your HTML page.

<div id='badrSalesmanTopViewed'></div>

Now, enjoy the expert salesman recommendations inside this div container.

Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


To fetch user recommended products, use the following REST API.

curl --include \ 'http://salesman.badrit.com/api/v1/recommendations/get_recommendation.json?access_token=ACCESS_TOKEN&user_id=USER_ID&item_id=ITEM_CATALOG_ID&recommendations_size=10'

  • user_id , item_id and recommendations_size are optional parameters.
  • If item_id is passed, salesman will recommend products only related to this product.


Now, enjoy the expert salesman recommendations.

Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


Include the following script into your HTML layout:

<script src='http://salesman.badrit.com/api.js'></script>

<script type='text/javascript'>
var salesman = new BadrSalesmanRecommender('ACCESS_TOKEN', {'user_id': 'USER_ID', 'item_id': 'ITEM_CATALOG_ID', 'recommendations_size': 10});
</script>

  • user_id , item_id and recommendations_size are optional parameters.
  • If user_id is not passed, a user cookie ID will be used by default.
  • If item_id is passed, salesman will recommend products only related to this product.


Then add a div with ID badrSalesmanAlsoBought in your HTML page.

<div id='badrSalesmanAlsoBought'></div>

Now, enjoy the expert salesman recommendations inside this div container.

Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


To fetch user recommended products, use the following REST API.

curl --include \ 'http://salesman.badrit.com/api/v1/recommendations/get_recommendation.json?access_token=ACCESS_TOKEN&user_id=USER_ID&item_id=ITEM_CATALOG_ID&recommendations_size=10'

  • user_id , item_id and recommendations_size are optional parameters.
  • If item_id is passed, salesman will recommend products only related to this product.
  • Now, enjoy the expert salesman recommendations.


Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


Include the following script into your HTML layout:

<script src='http://salesman.badrit.com/api.js'></script>

<script type='text/javascript'>
var salesman = new BadrSalesmanRecommender('ACCESS_TOKEN', {'user_id': 'USER_ID', 'item_id': 'ITEM_CATALOG_ID', 'recommendations_size': 10});
</script>

  • user_id , item_id and recommendations_size are optional parameters.
  • If user_id is not passed, a user cookie ID will be used by default.
  • If item_id is passed, salesman will recommend products only related to this product.


Then add a div with ID badrSalesmanCart in your HTML page.

<div id='badrSalesmanCart'></div>

Now, enjoy the expert salesman recommendations inside this div container.

Fetch user recommendations


Salesman will display personalized user recommended products. Salesman will display the top 10 recommended products by default.


To fetch user recommended products, use the following REST API.

curl --include \ 'http://salesman.badrit.com/api/v1/recommendations/get_recommendation.json?access_token=ACCESS_TOKEN&user_id=USER_ID&item_id=ITEM_CATALOG_ID&recommendations_size=10'

  • user_id , item_id and recommendations_size are optional parameters.
  • If item_id is passed, salesman will recommend products only related to this product.


Now, enjoy the expert salesman recommendations.