younifyd
Menu

Get autosuggestions

Get autosuggestions

GET/

Use it in a workflow

  1. Add a step and choose the Bloomreach Discovery connector.
  2. Pick the Get autosuggestions action (under Autosuggest).
  3. Fill in the fields below, then reference the result from later steps as {{getAutosuggestions.response.data}}.

Request

Query parameters

_br_uid_2stringrequired

A first-party cookie created by the {user.br} tracking pixel library (BrTrk). This cookie creates a unique, anonymous identifier for every browser or device. <br><br> Use the default value provided, which is already encoded.

Default "uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55"

callbackstring

Indicates whether to return data wrapped in the function for cross-origin requests. <br><br> For server-side requests, use the value **br_server**. For native-app requests, use the value **br_app**.

One ofbr_serverbr_app

catalog_viewsstringrequired

A list of catalog views that you want to see in your suggestions. You must specify the catalog name within the catalog view. For Product catalogs, the catalog name is the same value as your domain_key. <br><br> A **catalog_views** value contains the view_ids within a catalog separated by a colon. If you pass multiple catalogs in **catalog_views**, they must be pipe-separated. Attributes suggestions are enabled for the first two catalogs mentioned as part of catalog_views and only for the first view passed in each of the first two catalogs. <br><br> For example, **&catalog_views=product:store1,store2|recipe:premium|articles** would return text and attribute suggestions for the product catalog in the store1 view, and for the recipe catalog in the premium view; only text suggestions will be displayed for the articles catalog. <br><br> The example value shown here, <i>pacifichome</i>, is included for your convenience to send a request with <b>Try It</b>.

Default "pacifichome"

qstringrequired

Your site visitor's partial search query that Autosuggest should operate on. <br><br> You can percent encode spaces between terms as %20, or you can leave the spaces unencoded. <br><br> The example value shown here, <i>cha</i>, is included for your convenience to send a request with <b>Try It</b>.

Default "cha"

ref_urlstringrequired

The URL of the page or HTTP referrer where the request is started.

Default "https://example.com"

request_idstringrequired

An ID to track site visitor clicks. We recommend generating unique, random values of 13 digits to enable click-tracking. <br><br> {user.br} doesn't automatically enforce the requirements for this parameter. For example, you can enter test as your value for each instance of the request_id parameter without triggering an error message. However, using a unique value allows us to help you if you encounter a problem.

Default 1703497216731

request_typestringrequired

The type of API request. Value should be **suggest** for Autosuggest requests.

One ofsuggestDefault "suggest"

urlstringrequired

The absolute URL of the page where the request is initiated. Do not use a relative URL. <br><br> The example value shown here, <i>https://www.documentation-site.com</i>, is included for your convenience to send a request with <b>Try It</b>.

Default "https://www.documentation-site.com"

user_agentstring

The user agent of the browser that's making the search request. <br><br> Make sure that this value in your API request is the same as the value in the original request from your user. We optimize pages in part by crawling and gathering data, and the original user_agent lets us distinguish between our internal {user.br} users who QA pages and everyone else who visits your site.

user_idstring

The universal customer ID of the user. You only need to pass this field if your particular integration tracks customers this way. The parameter captures user IDs from the customer side, and reuses the information when powering apps or enhancing cross-device linking. In this way, {user.br} recognizes users in a way that's aligned with your system. <br><br> Use an anonymous string. Don't use email or other personally identifiable information. <br><br> If you do not track users this way, then omit this field.

Response

Returns 200 with an object. Read it in later steps with {{getAutosuggestions.response.data.<field>}}.

queryContextobject
originalQuerystring
suggestionGroupsarray<object>
attributeSuggestionsarray<object>3 fields
catalogNamestring
product_suggest_querystring
querySuggestionsarray<object>2 fields
searchSuggestionsarray<object>5 fields
viewstring
json
{
  "queryContext": {
    "originalQuery": "string"
  },
  "suggestionGroups": [
    {
      "attributeSuggestions": [
        {
          "attributeType": "string",
          "name": "string",
          "value": "string"
        }
      ],
      "catalogName": "string",
      "product_suggest_query": "string",
      "querySuggestions": [
        {
          "displayText": "string",
          "query": "string"
        }
      ],
      "searchSuggestions": [
        {
          "pid": "string",
          "sale_price": "string",
          "thumb_image": "string",
          "title": "string",
          "url": "string"
        }
      ],
      "view": "string"
    }
  ]
}

Need more? See the Bloomreach Discovery guide for connection setup and behaviour shared by every action.

Was this page helpful?