Skip to content

Save Items

Now you have to save data in item index. There are two different endpoints for saving data. One is POST /v1/item/save endpoint which you can use to upload and save your CSV data in item index. Another is POST /v1/item/save/remote endpoint. This endpoint fetches the item from external api and saves item to the database. In this tutorial, we are integrating Shop API so we will use POST /v1/item/save/remote endpoint to save our data. There are some required parameters that you need to pass to successfully save the items. The key and value type of the parameters depict below for better understanding:

name key type value type description
url str str Represents URL of the product details api from where you want to fetch items into recommender
method str str Represents api method of the endpoint from which you want to fetch data into recommender.
headers Optional[Dict[str, str]] str Represents the meta data associated with api request and response.
query_parameters Optional[Dict[str, str]] str Represents the query parameter of api endpoint. It could be required to fetch data from external api otherwise you can keep it empty.
body_parameters Optional[Dict[str, str]] str Represents the body parameter of api endpoint. It could be required to fetch data from external api otherwise you can keep it empty.
response_items_key str str Represents the key of response items which you want to fetch into recommender .
response_item_key Optional[str] str If you have multiple keys in response you can use the key from where you want to fetch items. It could be empty as well.

Example:

{
  "url": "https://api.doozie.ai/v1/api/items/search",
  "method": "POST",
  "headers": {
    "accept": "application/json",
    "Content-Type": "application/json"
  },
  "query_parameters": {
  },
  "body_parameters": {
    "rakuten_query_parameters": {
        "keyword": "Pant"
    },
    "yahoo_query_parameters": {
        "query": "Pant"
    }
  },
  "response_items_key": "result",
  "response_item_key": ""
}

Search Items

You can search items by passing list of item ids fromPOST /v1/items endpoint. This endpoint will return searched items with item details. There are some prerequisite parameters which you have to pass in request body.

Parameters:

name key type value type description
entity_id Optional[str] str entity_id could be either item_id or user_id or None.
ids List[str] str List of item ids.