anchor.diff:    "eventTime" : <TIME OF THIS EVENT>
   }'
   
  +# A user buys an item
  +
  +curl -i -X POST <URL OF EVENTSERVER>/events.json?accessKey=<ACCESS KEY> \
  +-H "Content-Type: application/json" \
  +-d '{
  +  "event" : "buy",
  +  "entityType" : "user"
  +  "entityId" : <USER ID>,
  +  "targetEntityType" : "item",
  +  "targetEntityId" : <ITEM ID>,
  +  "eventTime" : <TIME OF THIS EVENT>
  +}'
  +
   ```
     </div>
   </div>
  
positive.code: 
  ## Using the Engine
  
  Now, You can retrieve predicted results. To retrieve 4 items which are similar to item ID "i1". You send this JSON `{ "items": ["i1"], "num": 4 }` to the deployed engine and it will return a JSON of the recommended items. Simply send a query by making a HTTP request or through the `EngineClient` of an SDK:
  
  <div class="tabs">
    <div data-tab="Python SDK" data-lang="python">
  
negative.code: curl -H "Content-Type: application/json" \
  -d '{
    "user": "u1",
    "num": 4,
    "categories" : ["c4", "c3"],
    "blackList": ["i21", "i26", "i40"]
  }' \
  http://localhost:8000/queries.json
  
  {"itemScores":[{"item":"i4","score":0.006009267718658978},{"item":"i33","score":0.005999267822052033},{"item":"i14","score":0.005261309429391667},{"item":"i2","score":0.002848917309942939}]}
  ```
  
  ### Set unavailable itemConstraint
  
  Now let's send a item contraint "unaviable" (replace accessKey with your Access Key):
  
  ```
  curl -i -X POST http://localhost:7070/events.json?accessKey=zPkr6sBwQoBwBjVHK2hsF9u26L38ARSe19QzkdYentuomCtYSuH0vXP5fq7advo4 \
  -H "Content-Type: application/json" \
  -d '{
    "event" : "$set",
    "entityType" : "itemConstraint"
    "entityId" : "unavailable",
    "properties" : {
      "items": ["i4", "i14", "i11"],
    }
    "eventTime" : "2015-02-17T02:11:21.934Z"
  }'
  ```
  
  Try to get recommendation for user *u1* again, you will see the unavaiable items (e.g. i4, i14, i11). won't be recommended anymore:
  
  ```
  curl -H "Content-Type: application/json" \
  -d '{
    "user": "u1",
    "num": 4,
    "categories" : ["c4", "c3"],
    "blackList": ["i21", "i26", "i40"]
  }' \
  http://localhost:8000/queries.json
  
  {"itemScores":[{"item":"i33","score":0.005999267822052033},{"item":"i5","score":0.002848917309942939},{"item":"i2","score":0.002848917309942939},{"item":"i7","score":0.0017118948432933486}]}
  ```
  
  INFO: You should send the full list of unavailable items whenever there is any updates in the list.
  
  When there is no more unavilable items, simply set an empty list. ie.
  
  ```
  curl -i -X POST http://localhost:7070/events.json?accessKey=zPkr6sBwQoBwBjVHK2hsF9u26L38ARSe19QzkdYentuomCtYSuH0vXP5fq7advo4 \
  -H "Content-Type: application/json" \
  -d '{
    "event" : "$set",
    "entityType" : "itemConstraint"
    "entityId" : "unavailable",
    "properties" : {
      "items": [],
    }
    "eventTime" : "2015-02-18T02:11:21.934Z"
  }'
  ```
  
  
  #### [Next: DASE Components Explained](/templates/ecommercerecommendation/dase/)
  