Kea Labs Recommendation Engine - API reference (2.0)

Download OpenAPI specification:Download

Here you can find all the available API endpoints for managing items, users, their interactions and fetch recommendations

Authentication

Api_Key

Security Scheme Type API Key
Header parameter name: X-KEALABS-API-KEY

Kea_Labs_OAuth

Security Scheme Type OAuth2
password OAuth Flow
Token URL: https://oauth.kealabs.com
Scopes:
  • read_storage -

    Grants read access to the storage domain

  • write_storage -

    Grants write access to the storage domain

Attributes

Manage item or user attributes

Add item attributes

path Parameters
itemId
required
string

itemId

header Parameters
storageId
required
string

Storage id

Request Body schema: application/json

A list of attributes to add

Array
name
string

Name of the attribute

value
required
object

Attribute value. Can be of type boolean, String or number. To supply date and/or time, use ISO 8601 formatted string

Responses

200

OK

400

Bad Request. Please make sure the request provided has the right format and storageId is provided in the request header

401

Unauthorized. Please make sure you provide the correct API or OAuth token in your request

402

Payment Required. Payment is required to access the resource. Contact us for more details

403

Forbidden. Access to the resource is forbidden. Make sure you use the right API key or OAuth token

405

Invalid input

429

Api limit exceeded, please try again later or contact us for more details

500

Unexpected server error. Oops, looks like something went wrong on our side. Consider contacting us for more details

post/api/v2/attributes/item/{itemId}
https://localhost:8080/api/v2/attributes/item/{itemId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Delete item attributes

path Parameters
itemId
required
string

itemId

header Parameters
storageId
required
string

Storage id

Request Body schema: application/json

A list of attribute names to remove

Array
string

Responses

200

OK

400

Bad Request. Please make sure the request provided has the right format and storageId is provided in the request header

401

Unauthorized. Please make sure you provide the correct API or OAuth token in your request

402

Payment Required. Payment is required to access the resource. Contact us for more details

403

Forbidden. Access to the resource is forbidden. Make sure you use the right API key or OAuth token

405

Invalid input

429

Api limit exceeded, please try again later or contact us for more details

500

Unexpected server error. Oops, looks like something went wrong on our side. Consider contacting us for more details

delete/api/v2/attributes/item/{itemId}
https://localhost:8080/api/v2/attributes/item/{itemId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Add user attributes

path Parameters
userId
required
string

userId

header Parameters
storageId
required
string

Storage id

Request Body schema: application/json

A list of attributes to add

Array
name
string

Name of the attribute

value
required
object

Attribute value. Can be of type boolean, String or number. To supply date and/or time, use ISO 8601 formatted string

Responses

200

OK

400

Bad Request. Please make sure the request provided has the right format and storageId is provided in the request header

401

Unauthorized. Please make sure you provide the correct API or OAuth token in your request

402

Payment Required. Payment is required to access the resource. Contact us for more details

403

Forbidden. Access to the resource is forbidden. Make sure you use the right API key or OAuth token

405

Invalid input

429

Api limit exceeded, please try again later or contact us for more details

500

Unexpected server error. Oops, looks like something went wrong on our side. Consider contacting us for more details

post/api/v2/attributes/user/{userId}
https://localhost:8080/api/v2/attributes/user/{userId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Delete user attributes

path Parameters
userId
required
string

userId

header Parameters
storageId
required
string

Storage id

Request Body schema: application/json

A list of attributes names to remove

Array
name
string

Name of the attribute

value
required
object

Attribute value. Can be of type boolean, String or number. To supply date and/or time, use ISO 8601 formatted string

Responses

200

OK

400

Bad Request. Please make sure the request provided has the right format and storageId is provided in the request header

401

Unauthorized. Please make sure you provide the correct API or OAuth token in your request

402

Payment Required. Payment is required to access the resource. Contact us for more details

403

Forbidden. Access to the resource is forbidden. Make sure you use the right API key or OAuth token

405

Invalid input

429

Api limit exceeded, please try again later or contact us for more details

500

Unexpected server error. Oops, looks like something went wrong on our side. Consider contacting us for more details

delete/api/v2/attributes/user/{userId}
https://localhost:8080/api/v2/attributes/user/{userId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Events

Send user-related events to the recommendation platform

Get all Add to Cart events by userId and itemId. It returns all added to cart items by user userId, if itemId is not specified. Or, all users who added to cart item itemId if userId is not specified.

path Parameters
id
required
string

id

query Parameters
after
string

Filter by event timestamp. Minimal date. ISO-8601-1 string in UTC timezone

before
string

Filter by event timestamp. Maximal date. ISO-8601-1 string in UTC timezone

itemId
string

Filter by item Id

userId
string

Filter by user Id

header Parameters
storageId
required
string

Storage id

Responses

200

OK

400

At least one of userId or itemId parameters has to be specified

401

Unauthorized. Please make sure you provide the correct API or OAuth token in your request

402

Payment Required. Payment is required to access the resource. Contact us for more details

403

Forbidden. Access to the resource is forbidden. Make sure you use the right API key or OAuth token

429

Api limit exceeded, please try again later or contact us for more details

500

Unexpected server error. Oops, looks like something went wrong on our side. Consider contacting us for more details

get/api/v2/events/cart/add
https://localhost:8080/api/v2/events/cart/add

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Add a new Add to Cart Event

header Parameters
storageId
required
string

Storage id

Request Body schema: application/json

Event data object

itemId
required
string

Id of item added to cart

price
number <double>

Price of one item.

quantity
integer <int32>

Number of currently adding items. For example, if user already has 3 items with this itemId in the cart and adds one more, this fields needs to be 1

timestamp
string <date-time>

Timestamp of event in UTC timezone in ISO-8601-1 format. Default value is current timestamp

totalQuantity
integer <int32>

Total number of added items in a card.

userId
required
string

User Id

Responses

200

OK

400

Bad Request. Please make sure the request provided has the right format and storageId is provided in the request header

401

Unauthorized. Please make sure you provide the correct API or OAuth token in your request

402

Payment Required. Payment is required to access the resource. Contact us for more details

403

Forbidden. Access to the resource is forbidden. Make sure you use the right API key or OAuth token

405

Invalid input

429

Api limit exceeded, please try again later or contact us for more details

500

Unexpected server error. Oops, looks like something went wrong on our side. Consider contacting us for more details

post/api/v2/events/cart/add
https://localhost:8080/api/v2/events/cart/add

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "itemId": "string",
  • "price": 0,
  • "quantity": 0,
  • "timestamp": "2019-09-15T15:53:42+02:00",
  • "totalQuantity": 0,
  • "userId": "string"
}

Delete an Add to Cart event for a given userId, itemId and timestamp. It deletes all Add to Cart events for userId and itemId if timestamp is not specified

query Parameters
after
string

Filter by event timestamp. Minimal date. ISO-8601-1 string in UTC timezone

before
string

Filter by event timestamp. Maximal date. ISO-8601-1 string in UTC timezone

itemId
string

Item Id

timestamp
string

Filter by event timestamp

userId
string

User Id

header Parameters
storageId
required
string

Storage id

Responses

200

OK

400

At least one of userId or itemId parameters has to be specified

401

Unauthorized. Please make sure you provide the correct API or OAuth token in your request

402

Payment Required. Payment is required to access the resource. Contact us for more details

403

Forbidden. Access to the resource is forbidden. Make sure you use the right API key or OAuth token

429

Api limit exceeded, please try again later or contact us for more details

500

Unexpected server error. Oops, looks like something went wrong on our side. Consider contacting us for more details

delete/api/v2/events/cart/add
https://localhost:8080/api/v2/events/cart/add

Get all Purchase events by userId and itemId. It returns all purchased items by user userId, if itemId is not specified. Or, all users who purchased item itemId if userId is not specified.

path Parameters
id
required
string

id

query Parameters
after
string

Filter by event timestamp. Minimal date. ISO-8601-1 string in UTC timezone

before
string

Filter by event timestamp. Maximal date. ISO-8601-1 string in UTC timezone

itemId
string

Filter by item Id

userId
string

Filter by user Id

header Parameters
storageId
required
string

Storage id

Responses

200

OK

400

At least one of userId or itemId parameters has to be specified

401

Unauthorized. Please make sure you provide the correct API or OAuth token in your request

402

Payment Required. Payment is required to access the resource. Contact us for more details

403

Forbidden. Access to the resource is forbidden. Make sure you use the right API key or OAuth token

429

Api limit exceeded, please try again later or contact us for more details

500

Unexpected server error. Oops, looks like something went wrong on our side. Consider contacting us for more details

get/api/v2/events/purchase
https://localhost:8080/api/v2/events/purchase

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Add a new Purchase Event

header Parameters
storageId
required
string

Storage id

Request Body schema: application/json

Event data object

itemId
required
string

Id of purchased item

price
number <double>

Price of one item.

quantity
integer <int32>

Number of purchased items.

timestamp
string <date-time>

Timestamp of event in UTC timezone in ISO-8601-1 format. Default value is current timestamp

userId
required
string

User Id

Responses

200

OK

400

Bad Request. Please make sure the request provided has the right format and storageId is provided in the request header

401

Unauthorized. Please make sure you provide the correct API or OAuth token in your request

402

Payment Required. Payment is required to access the resource. Contact us for more details

403

Forbidden. Access to the resource is forbidden. Make sure you use the right API key or OAuth token

405

Invalid input

429

Api limit exceeded, please try again later or contact us for more details

500

Unexpected server error. Oops, looks like something went wrong on our side. Consider contacting us for more details

post/api/v2/events/purchase
https://localhost:8080/api/v2/events/purchase

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "itemId": "string",
  • "price": 0,
  • "quantity": 0,
  • "timestamp": "2019-09-15T15:53:42+02:00",
  • "userId": "string"
}

Delete a Purchase event for a given userId, itemId and timestamp. It deletes all Purchase events for userId and itemId if timestamp is not specified

query Parameters
after
string

Filter by event timestamp. Minimal date. ISO-8601-1 string in UTC timezone

before
string

Filter by event timestamp. Maximal date. ISO-8601-1 string in UTC timezone

itemId
string

Item Id

timestamp
string

Filter by event timestamp

userId
string

User Id

header Parameters
storageId
required
string

Storage id

Responses

200

OK

400

At least one of userId or itemId parameters has to be specified

401

Unauthorized. Please make sure you provide the correct API or OAuth token in your request

402

Payment Required. Payment is required to access the resource. Contact us for more details

403

Forbidden. Access to the resource is forbidden. Make sure you use the right API key or OAuth token

429

Api limit exceeded, please try again later or contact us for more details

500

Unexpected server error. Oops, looks like something went wrong on our side. Consider contacting us for more details

delete/api/v2/events/purchase
https://localhost:8080/api/v2/events/purchase

Get all Rate events by userId and itemId. It returns all rated items by user userId, if itemId is not specified. Or, all users who rated item itemId if userId is not specified.

path Parameters