curl --request POST \
--url https://api-{dc}.moengage.com/v1/recommendations/{recommendation_id}/items \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <moe-appkey>' \
--header 'RECOMMENDATION-TYPE: <recommendation-type>' \
--data '
{
"user_id": "[email protected]",
"item_id": "product_sku_abc",
"include_fields": [
"title",
"image_link",
"price"
]
}
'{
"items": [
{
"item_id": "prod_xyz",
"title": "Stylish Red Scarf",
"link": "https://example.com/products/prod_xyz",
"image_link": "https://example.com/images/prod_xyz.jpg",
"price": 19.99,
"fabric": "Silk"
}
]
}{
"code": "recommendation does not exist",
"message": "Recommendation does not exist or archived. Please check recommendation_id."
}{
"code": "request-unauthenticated",
"message": "Your request is unauthorized. Please verify your credentials and try again."
}{
"code": "payload-size-exceeded",
"message": "Your payload size exceeds the 1MB limit. Please reduce the payload size and try again."
}{
"code": "unexpected-error",
"message": "Something went wrong with your request. Please contact the MoEngage team for further assistance."
}Fetch Recommendation Results
This API fetches/retrieves the metadata results of any recommendations for a user based on their user ID and item ID.
curl --request POST \
--url https://api-{dc}.moengage.com/v1/recommendations/{recommendation_id}/items \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <moe-appkey>' \
--header 'RECOMMENDATION-TYPE: <recommendation-type>' \
--data '
{
"user_id": "[email protected]",
"item_id": "product_sku_abc",
"include_fields": [
"title",
"image_link",
"price"
]
}
'{
"items": [
{
"item_id": "prod_xyz",
"title": "Stylish Red Scarf",
"link": "https://example.com/products/prod_xyz",
"image_link": "https://example.com/images/prod_xyz.jpg",
"price": 19.99,
"fabric": "Silk"
}
]
}{
"code": "recommendation does not exist",
"message": "Recommendation does not exist or archived. Please check recommendation_id."
}{
"code": "request-unauthenticated",
"message": "Your request is unauthorized. Please verify your credentials and try again."
}{
"code": "payload-size-exceeded",
"message": "Your payload size exceeds the 1MB limit. Please reduce the payload size and try again."
}{
"code": "unexpected-error",
"message": "Something went wrong with your request. Please contact the MoEngage team for further assistance."
}Rate Limit
You can make 10,000 requests per minute.Authorizations
Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.
- Username: Use your MoEngage workspace ID (also known as the App ID). You can find it in the MoEngage dashboard at Settings > Account > API keys.
- Password: Use the Campaign report/Business events/Custom templates/Catalog API/Inform Report key from Settings > Account > API keys. Its auth type is Basic Auth (Legacy). This API accepts only this legacy key, so a key you create with + Create new key doesn't work with it.
For the key that each MoEngage API accepts, refer to API Keys by Feature.
Headers
Path Parameters
Body
A user ID is a unique identifier that represents a user. You can obtain the user_id from the user info page. For more information, refer to User Identity Management.
An item_id is a unique identifier assigned to each item in the catalog.
If the RECOMMENDATION-TYPE is any of the similar_item, frequently_viewed_together, or frequently_bought_together, you must provide the item_id.
This item_id acts as the anchor to serve recommended items based on the RECOMMENDATION-TYPE.
We expect the user's most recently interacted item_id to serve contextually recommended items.
You can define the attributes of items you require from the catalog in the recommendation response. For example, title, price, link, image_link, and so on.
If you don't define any attributes, the response includes every item attribute in the catalog. This increases the response size in proportion to the number of attributes in your catalog. Specify only the attributes you need.
["title", "price", "image_link"]