younifyd
Menu

Search Content

Search for content assets.

GET/organizations/{organizationId}/content-search

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Search Content action (under Shopper Experience).
  3. Fill in the fields below, then reference the result from later steps as {{searchContent.response.data}}.

Request

Path parameters

organizationIdstringrequired

An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).

Query parameters

qstring

The query phrase to search for content assets. For example, to search for content with "banner", type q=banner.

refinestring

Parameter that represents a refinement attribute/value(s) pair. Refinement attribute ID and value(s) are separated by '='. Multiple values are supported by a subset of refinement attributes and can be provided by separating them using a pipe (URL encoded = "|"). Value ranges can be specified like this: refine=foo=(100..500). Multiple refine parameters can be provided by adding an underscore in combination with an integer counter right behind the parameter name and a counter range 1..9. I.e. refine_1=c_refinementType=type1|type2|type3. The following system refinement attribute IDs are supported: - `fdid`: Allows refinement per single content folder ID. Multiple folder IDs are not supported.

sortstring

Parameter that represents a sorting attribute/value(s) pair. Sorting attribute ID and value are separated by '='. The value describes the sort direction. Possible values are 'asc' and 'desc', for ascending or descending sort direction. I.e. sort=c_myAttribute=desc. Precondition: You have to select your sorting attributes in Business Manager > YourSite > Search Indexes > Content Index > Sorting Attributes.

siteIdstringrequired

The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.

localeoneOf

A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.

limitinteger (int32)

Number of records to retrieve per request. Must be between 1 (minimum) and 200 (maximum). Defaults to 50.

Default 50

offsetinteger (int32)

Used to retrieve the results based on a particular resource offset.

Default 0

Response

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

querystring

The query String that was searched for.

hitsarray<object>

The sorted array of search hits. Can be empty.

idanyrequired
namestring

The localized content asset name.

descriptionstring

The localized content asset description.

pageDescriptionstring

The localized content asset page description for SEO.

pageKeywordsstring

The localized content asset page keywords for SEO.

pageTitlestring

The localized content asset page title for SEO

selectedRefinementsobject

Map of selected refinement attribute id/value(s) pairs. The sorting order is the same like in request URL.

refinementsarray<object>

The sorted array of search refinements. Can be empty.

attributeIdstringrequired

The ID of the refinement attribute.

labelstring

The localized label of the refinement attribute.

valuesarray<object>3 fields

The array of refinement values.

json
{
  "hits": [
    {
      "id": null,
      "name": "Homepage Banner",
      "description": "Main banner displayed on the homepage",
      "pageDescription": "Discover our latest products and offers",
      "pageKeywords": "products, offers, sale, fashion",
      "pageTitle": "Shop Now - Best Deals"
    }
  ],
  "query": "banner",
  "selectedRefinements": {
    "fdid": "homepage-folder",
    "c_contentType": "banner"
  },
  "refinements": [
    {
      "attributeId": "c_contentType",
      "label": "Content Type",
      "values": [
        {
          "value": "banner",
          "label": "Banner",
          "hitCount": 5
        }
      ]
    }
  ]
}

Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.