This template shows a simple bot that displays five men or woman shirts and its price, we are getting the clothes information on the
First of all, we ask what are the user interests. When we get it, we generate the carousel of the products.
Also, at the
botonicInit necessary calls are made to grasp the values of api, which must be stored and returned so that they can be passed as parameters.
To make the call, we need
import fetch from 'isomorphic-fetch' which needs to pass the url, the method that in this case is a
GET method and the parameters if needed. This call returns all the information on the
When we have all the product information, we can display the carousel.
The carousel can have at most ten elements, where each element will represent one product and will have its
image and a
link to the product page.
For access to these values, we do a loop with all the products where we extract the values like
Note: In order to import the
fetch function from
isomorphic-fetch, you need to install it into your bot. Please do:
npm install isomorphic-fetch