Core Integration recsForPlacements API

Description

This endpoint logs shopper behavior and when used with a placement name returns recommendations for a named placement.

URL

Production

Use this URL to request personalization from your production environment.

Copy
https://recs.richrelevance.com/rrserver/api/rrPlatform/recsForPlacements

Integration

Use this URL to request personalization from your QA, staging or development environment. This way, you can test change without impacting your production environment.

Copy
https://integration.richrelevance.com/rrserver/api/rrPlatform/recsForPlacements

Parameters

    Notes:
  • You need only call parameters.

  • Algonomy operates off a set of APIs that support many applications and clients concurrently. Algonomy may update and enhance these APIs at any time. 
  • All parameters are case sensitive.

Name

Required or Optional

Description

aari

Optional

Already added registry items. A single (or list of) product ID(s). If there is more than one product in the registry, separate the IDs using the pipe '|' character.

Example: ​aari=33306|909119|305466

apiClientKey

Required

A unique key specific to each API implementation. It identifies the specific application or client for reporting, permissions, and merchandising. This is provided by Algonomy.

Example: apiClientKey=b0126f995ac848159d

apiKey

Required

A unique key that identifies the site. Each Algonomy client has a unique API key to separate data and traffic from other clients. This is provided by Algonomy.

Example: apiKey=4faeaf752ee40a0f

atcid

Required on Add to Cart page

Add to Cart ID. This can be a single product ID or a list of product IDs. If more than one product is added to the cart, separate the product IDs by using the pipe "|" character.

Example: atcid=uv2345|xt1234

bi

Optional

A list of product IDs that should not be recommended in this response. Use the pipe "|" character to separate product IDs.

Example: bi=93874|04495|043945

categoryData

Optional

Omits category data (categoryIds and categories) when set to false. The default is true.

Example: categoryData=false

categoryId

Required on category_page

The category ID of the category the merchant wants to investigate. The value must match the external ID provided by the merchant to Algonomy for the category.

Example: categoryId=902312

chi

Optional

Supplies category hint IDs. Category hints can be added to any page type. Each category hint qualifies the page for merchandising rules that are associated to the category. Merchants can add multiple category hints to a single page. The values are separated by the pipe "|" character. 

Example: chi=1913000|1903094

count

Optional

The total number of products to return in the response. This value overrides the return count set in the placement or in the Search and Browse configuration. For example, if you want to return products 30 through 60, set the value to 30. The maximum value is 1000.

Example: count=30

Note: This is for Search and Browse only. When using pagination this parameter together with st is required.

cv

Optional

Cart value. Used for targeted campaigns involving cart value. It's expressed in cents; for example, $10 is represented as 1000.


Example: cv=9550 (this would equal to 95.50)

excludeHtml

Optional

True/false. If true, it omits the HTML returned in the Algonomy server response. If false, the response includes the HTML for the placement which is set in the layout of the html field. The default is false. 

Example: excludeHtml=true

 

filterAtr

Optional

Filter types and values selected by the shopper. Place quotation marks around all attributes, separate the types by using the pipe "|" character, and separate the values by using a semicolon. You must include quotation marks around all attributes.

Example: filterAtr=brand:"adidas"|size:"M";"L"

Note: This is for Search and Browse only, and it needs configuration by RichRelevance first.

flv

Optional

Flash version of the browser. It's only used if content displayed is flash.

Example: flv=20.0.0.306

fpb

Optional

The brand featured on the page. Used to set the seed for brand-seeded strategies, such as Brand Top Sellers.

Example: fpb=Microsoft

includeBrand

FilteredProducts

Optional

True/false. Changes the function of filbr from exclude to include. If not specified, the default is false, which will exclude the specified brand. If true, the brand filter excludes all products except the specified brand.

Example: includeBrandFilteredProducts=true

ipor

Optional

Shopper IP address. Only use if the API request is not coming from the shopper’s device (for example, server-side integration).

Example: ipor=255.255.255.255

jcb

Required for jsonp

Name of the JavaScript function that JSON data is passed to. Must be specified if jsonp is set to true.

Example: jcb=processData

jsonp

Optional

Boolean flag. The only valid value is true. If set to true, the jcb parameter must also be provided.

Example: jsonp=true

o

 

Required on purchase_complete_page

Order ID. Part of the order definition. Example: o=902312

placements

Required

Placement identifier which consists of a page type. You cannot mix identifier of different page types here.

Example: placements=item_page

pp

Required on purchase_complete_page

Product prices. A list defining the prices of purchased products. The index of product prices in the list corresponds to the products passed in productId. This is part of the order definition. Use either pp or ppc to define the price of items purchased. If you use pp, the site’s currency multiplier is applied. The values are separated by the pipe "|" character.

Example: pp=29.99|32.97

ppc

Required on purchase_complete_page

Product prices in cents. A list defining the prices of purchased products. The index of product prices in the list corresponds to the products passed in productId. This is part of the order definition. Use either pp or ppc to define the price of items purchased. If you use ppc, the site’s currency multiplier is not applied.

The passed value is accepted as-is, and is converted from a string to an integer. Be certain that the string you pass contains only numerals (no currency symbols or separators). The values are separated by the pipe "|" character.

Example: ppc=2999|3297 (these values are $29.99 and $32.97)

productId

Required on item_page, purchase_complete_page, and cart_page (when not empty)

A single product ID, or a list of product IDs. Part of an order definition on the purchase complete page. Use the pipe "|" character to separate the product IDs.

Example: productId=uv2345|xt1234

Note: For the add_to_cart_page request, the product ID is passed as the Add to Cart ID through the 'atcid' parameter. Hence this productId field is not required.

q

Required on purchase_complete_page

Item quantities. A list defining the quantities of products purchased. The index of quantities in the list corresponds to the index of the products passed in productId. This is part of the order definition. Multiple entries are separated by the pipe "|" character.

Example: q=2|1

rcs

Required

First party cookie string. This is an encrypted value of Algonomy cookies. It should be passed as it was received in the earlier API response.

rg

Optional

Used to identify a particular registry.

Example: rg=Registry123454321

rgt

Optional

Registry type ID. Contact Algonomy for a list of registry type IDs for your site.

Example: ​rgt=wedding

rid

Optional

Region ID. Must be consistent with the ID used in the product region feed.

Example: rid=Switzerland-France

searchTerm

Required on search_page

The search term typed in by the shopper. You can also use the productId parameter to provide product IDs of the products in the search results.

Example: searchTerm=adriana lima

sessionId

Required

Identifies a single visit by a shopper.  Sessions are used by behavioral models (to scope user behaviour in a shopping session) and reporting metrics.

Example: sessionId=93484

sgs

Optional

Supply user segments. Used for segment-targeted campaigns. List each segment using the format segment_number:segment_name, and then use the pipe "|" character to separate segments. You must pass both the segment ID and a segment name for each segment.

Example: sgs=101:NewUser|202:Male

st

Optional

The starting number for the products that you want to return. For example, if you want to return products 30 through 60, set the value to 30.

Note: This is for Search and Browse only. When using pagination this parameter together with count is required.

Example: st=30

ts

Optional

Timestamp. It's used for browser cache busting, and is highly recommended. If excluded, you may see cached responses.

Example: ts=1376676943

userAttribute

Optional

Custom keys and values that describe the current shopper. Separate information using a semicolon and the pipe "|" character.

Example: userAttribute=eye_color:blue;green|hair_color:brown

userAttributeReplace

Optional

Usage is same as userAttribute, except that the attributes sent along with userAttributeReplace will replace all previously sent values for that attribute.

Example: userAttributeReplace=eye_color:black

In the above example all previous values of eye_color will be removed and replaced with black.

If the same attribute is sent along in a single request in userAttribute as well as userAttributeReplace, then the value sent in userAttributeReplace will take precedence.

This attribute also supports Delete update against attribute values. Example: userAttribute=eye_color:|hair_color:

userId

Optional

User ID. A unique string to identify each shopper (user). All shopper behavior is stored using this key. It is case-sensitive, and should be the same user ID sent to Algonomy in other applications.

Example: userId=0982347

#1 Example Requests (Core)

Retrieve the rcs parameter with Home Page placement page type.

Copy
GET /rrserver/api/rrPlatform/recsForPlacements?apiKey=showcaseparent&apiClientKey=776cdd80331919e7&userId=48454648&sessionId=827ccb0eea8a706c4c34a16891f84e7b&placements=home_page

Retrieve the rcs parameter with Item Page placement page type using the seed product ID 24516217 for the user with ID 48454648.

Copy
GET /rrserver/api/rrPlatform/recsForPlacements?apiKey=showcaseparent&apiClientKey=776cdd80331919e7&userId=48454648&sessionId=827ccb0eea8a706c4c34a16891f84e7b&placements=item_page&productId=24516217

Retrieve the rcs parameter with Add to Cart Page placement page type, for the user with ID 48454648, passing 24516217 (the ID of the product added to the cart) in the atcid parameter.

Copy
GET /rrserver/api/rrPlatform/recsForPlacements?apiKey=showcaseparent&apiClientKey=776cdd80331919e7&userId=48454648&sessionId=827ccb0eea8a706c4c34a16891f84e7b&placements=add_to_cart_page&atcid=24516217

#1 Example Response

Copy
{
  "rcs": "eF5j4cotK8lM4TMzsNA11DVkKU32MEkyBAJjM11jYzMzXRNTozRdA0sgYZxiammQaGJmZmaaDABuTQ0O",
  "status": "ok"
}

#2 Example Requests

Retrieve the rcs parameter with Category Page placement page for user ID 48454648, and for category 6406:

Copy
GET /rrserver/api/rrPlatform/recsForPlacements?apiKey=a6x5029gd6941a22&st=0&count=20&apiClientKey=x3f023fd649003&placements=category_page &sessionId=27083322340392734752015&userId=48454648&categoryId=6406

#2 Example Response

The response is a JSON object with rcs and status.

Copy
{
  "rcs": "eF5j48otK8lM4TGy0DXUNWQpTfZINU80TLG0NNdNtrRM1DUxSk3WNTY3NdI1MjM1MUg1TzI0SzPgKgXqSeYwstBLBAAmHBDP",
  "status": "ok"
}