getProductSearchResultsWithHttpInfo method

Future<Response> getProductSearchResultsWithHttpInfo(
  1. int accountId,
  2. String authKey,
  3. String brUid2,
  4. String domainKey,
  5. String fl,
  6. String q,
  7. String requestId,
  8. String requestType,
  9. String searchType,
  10. int start,
  11. int rows,
  12. String url,
  13. String refUrl, {
  14. String? callback,
  15. String? efq,
  16. String? facetPeriodRange,
  17. String? fq,
  18. String? ll,
  19. String? sort,
  20. String? statsPeriodField,
  21. String? userId,
  22. String? viewId,
  23. String? widgetId,
})

Returns product data and attriutes based on inputted query structure. Queries can also include filters and facets.

Note: This method returns the HTTP Response.

Parameters:

  • int accountId (required): Your site's numerical Bloomreach account ID. Your Bloomreach representative gives your site's account ID to you before or during your integration kickoff meeting.

  • String authKey (required): The Bloomreach-provided authentication key for the Bloomreach account that's sending the request.

  • String brUid2 (required): A first-party cookie created by the Bloomreach tracking pixel library (BrTrk). This cookie creates a unique, anonymous identifier for every browser or device.

  • String domainKey (required): Site domain ID which is provided by Bloomreach

  • String fl (required): Filtered list of attributes you want returned in your API response (i.e. productID, price). Multiplevalues should be comma separated)

  • String q (required): Your site visitor's partial search query that Autosuggest should operate on. You can percent encode spaces between terms as %20, or you can leave the spaces unencoded.

  • String requestId (required): An ID to track site visitor clicks. We recommend that you generate unique, random values of 13 digits to enable click-tracking.

  • String requestType (required): The type of API request. Value should be suggest for Autosuggest requests.

  • String searchType (required): The type of search. Value should be keyword for Product Search requests, category for Category requests.

  • int start (required): The number of the first item on a page of results. For example, the first item on the first page is 0, making the start value also 0. The maximum value is 10000.

  • int rows (required): The number of matching items to return per results page in the API response. The maximum value is 200.

  • String url (required): The URL of the page or HTTP referrer where the request is started.

  • String refUrl (required): The URL of the page or HTTP referrer where the request is started.

  • String callback: Indicates whether to return data wrapped in the function for cross-origin requests.

  • String efq: Extends the filtered query and applies a complex boolean filter to search results to include or exclude items that fit your parameter values. Any product attribute in your product feed is valid, such as brand names and sizes.

  • String facetPeriodRange: Return a count of ranged facets, such as price and sale price. Use numeric attributes only. You need to parse the values that are in the facets_counts section of the response.

  • String fq: The fq parameter applies a faceted filter to the returned products, searching for products that fit your parameter values. Use fq=store_lat_lon to enable filtering by distance for BOPIS.

  • String ll: The latitude-longitude of the end-customer used for the Buy Online Pick-up In Store (BOPIS) feature. Value should be provided as latitude,longitude. For example, ll=11.09,10.018.

  • String sort: Sorts results based on the field value in ascending, descending, or another combination of orders. You can sort any fl field. Value is a field name, followed by asc/desc for ascending/descending order respectively.

  • String statsPeriodField: This parameter allows you to display the maximum and minimum values of any numeric field in your data set for a user query. With this parameter, you can get all the documents matching a query and display the minimum and maximum values of single-valued, numeric attributes such as price, sale_price, length, width, reviews, etc.

  • String userId: 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, Bloomreach recognizes users in a way that's aligned with your system. Use an anonymous string. Don't use email or other personally identifiable information. If you do not track users this way, then omit this field.

  • String viewId: A unique identifier for a specific view of your product catalog. If you have multiple versions of your site, each with their own product catalog characteristics like product titles and prices, then add view_id to your call. Bloomreach uses your view_id parameter value to display the right product information for your customers based on their individual site views. You can enter any string value to identify the specific site catalog view. This string must be consistent in your pixel, API, and product catalog.

  • String widgetId: The widget_id provided in the Dashboard for the Dynamic Widgets feature, which is used to provided curated results.This is an optional feature that can be enabled by discussing with your CSM.

Implementation

Future<Response> getProductSearchResultsWithHttpInfo(
  int accountId,
  String authKey,
  String brUid2,
  String domainKey,
  String fl,
  String q,
  String requestId,
  String requestType,
  String searchType,
  int start,
  int rows,
  String url,
  String refUrl, {
  String? callback,
  String? efq,
  String? facetPeriodRange,
  String? fq,
  String? ll,
  String? sort,
  String? statsPeriodField,
  String? userId,
  String? viewId,
  String? widgetId,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/';

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};

  queryParams.addAll(_queryParams('', 'account_id', accountId));
  queryParams.addAll(_queryParams('', 'auth_key', authKey));
  queryParams.addAll(_queryParams('', '_br_uid_2', brUid2));
  queryParams.addAll(_queryParams('', 'domain_key', domainKey));
  queryParams.addAll(_queryParams('', 'fl', fl));
  queryParams.addAll(_queryParams('', 'q', q));
  queryParams.addAll(_queryParams('', 'request_id', requestId));
  queryParams.addAll(_queryParams('', 'request_type', requestType));
  queryParams.addAll(_queryParams('', 'search_type', searchType));
  queryParams.addAll(_queryParams('', 'start', start));
  queryParams.addAll(_queryParams('', 'rows', rows));
  queryParams.addAll(_queryParams('', 'url', url));
  queryParams.addAll(_queryParams('', 'ref_url', refUrl));
  if (callback != null) {
    queryParams.addAll(_queryParams('', 'callback', callback));
  }
  if (efq != null) {
    queryParams.addAll(_queryParams('', 'efq', efq));
  }
  if (facetPeriodRange != null) {
    queryParams.addAll(_queryParams('', 'facet.range', facetPeriodRange));
  }
  if (fq != null) {
    queryParams.addAll(_queryParams('', 'fq', fq));
  }
  if (ll != null) {
    queryParams.addAll(_queryParams('', 'll', ll));
  }
  if (sort != null) {
    queryParams.addAll(_queryParams('', 'sort', sort));
  }
  if (statsPeriodField != null) {
    queryParams.addAll(_queryParams('', 'stats.field', statsPeriodField));
  }
  if (userId != null) {
    queryParams.addAll(_queryParams('', 'user_id', userId));
  }
  if (viewId != null) {
    queryParams.addAll(_queryParams('', 'view_id', viewId));
  }
  if (widgetId != null) {
    queryParams.addAll(_queryParams('', 'widget_id', widgetId));
  }

  const contentTypes = <String>[];

  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    headerParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}