com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

Retrieving Product Recommendations via REST API

Overview

DescriptionRetrieving the recommended products with a model that uses a collaborative filtering algorithm.
Resource Pathapi/models/{modelId}/product-recommendations?userId={user-id}&noOfProducts{no-of-products}
HTTP MethodGET
Request/Response FormatApplication/JSON
Parameter description
ParameterDescription
{modelId}
The ID of the model used to make the product recommendation.
{user-id}
The user ID based on which the product recommendation is made.
{no-of-products}
The number of product recommendations that should be retrieved.

Sample cURL command

curl -H "Content-Type: application/json" -H "Authorization: Basic YWRtaW46YWRtaW4=" -k -v "https://localhost:9443/api/models/${modelId}/product-recommendations?user-id=1&no-of-products=3"

Example

 GET https://localhost:9443/api/models/{modelId}/product-recommendations?userId={user-id}&noOfProducts{no-of-products}

Sample output

 [125,123,124]

REST API response

HTTP status code

200, 404 or 500

For descriptions of the HTTP status codes, see HTTP Status Codes.