logo

English

Recommendation Feedback

Use this API when a user clicks on a recommended document.
GET /api/v2/projects/{project}/collections/{collection}/recommend/feedback/hits
OR
POST /api/v2/projects/{project}/collections/{collection}/recommend/feedback/hits
OR
GET /api/v2/projects/{project}/collections/{collection}/recommend/{handler}/feedback/hits
OR
POST /api/v2/projects/{project}/collections/{collection}/recommend/{handler}/feedback/hits
Where:
  1. {project} is your project name, e.x wptest.
  2. {collection} is the name of collection of documents you want to search in, e.x posts.
  3. {handler} is the recommender system handler, set it to default if you have not created your own custom search handler.

Querystring parameters (Body if POST):

  1. source_id: source document id, e.x ?source_id=1.
  2. source_title: source document title, e.x ?source_title=example title.
  3. source_url: source document url, e.x ?source_url=http://mysite.com/posts/example-title.
  4. target_id: target document id, e.x ?target_id=2.
  5. target_title: target document title, e.x ?target_title=target title.
  6. target_url: target document url, e.x ?target_url=http://mysite.com/posts/target-title.
  7. item_order: the index of the clicked recommendation starting from 1, e.x ?item_order=2.
  8. session_id: user session id, e.x ?session_id=xDijefr342xesdf.
  9. user_id: a unique identifier for a user, e.x ?user_id=1.
  10. user_ip: user ip address, e.x ?user_ip=192.111.24.21.
  11. user_country: user country code, e.x ?user_country=DE.

Example request:

https://api-bahuth.lableb.com/api/v2/projects/wptest/collections/posts/recommend/default/feedback/hits
  ?source_id=1
  &source_title=example title
  &target_id=2
  &target_title=target title
  &item_order=3
  &session_id=1c4Hb23
  &token=qxDFI791xxxx-8wmxIBIONYiEK44PGnxxxxxx

Example response:

{
  "time": 6,
  "code": 200,
  "response": null
}