CatalogSearch resource (Data API 19.1)

Summary

Http Method Resource Description
POST /catalog_search

Searches for catalogs.

The query attribute specifies a complex query that can be used to narrow down the search. These are the list of searchable attributes:

  • id - String
  • name - String
  • description - String
  • creation_date - DateTime

There are two additional fields that can be used as search filters. They are not attributes in CatalogWO object, but can be used as filters to query catalogs based on site assignments.

  • is_master_catalog - Boolean
  • is_storefront_catalog - Boolean

On using is_master_catalog in the search query, catalogs without any site assignments are returned. On using is_storefront_catalog in the search query, catalogs with one or more site assignments are returned.

The output of the query can also be sorted. These are the list of sortable attributes:

  • id - String
  • name - String
  • description - String
  • creation_date - DateTime

Search Catalogs

Searches for catalogs.

The query attribute specifies a complex query that can be used to narrow down the search. These are the list of searchable attributes:

There are two additional fields that can be used as search filters. They are not attributes in CatalogWO object, but can be used as filters to query catalogs based on site assignments.

On using is_master_catalog in the search query, catalogs without any site assignments are returned. On using is_storefront_catalog in the search query, catalogs with one or more site assignments are returned.

The output of the query can also be sorted. These are the list of sortable attributes:

Url

POST https://hostname:port/dw/data/v19_1/catalog_search

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

SearchRequest

Response Document

CatalogSearchResult

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 MalformedSearchParameterException   Thrown if the query is ill-formed.

Sample

REQUEST:
POST /s/-/dw/data/v19_1/catalog_search HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Accept: application/json

{   "query" : { 
        "term_query": { 
            "fields" : ["is_storefront_catalog"], 
            "operator" : "is",
            "values" : [true] 
        }
    },
    "select" : "(**)" 
}

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 367
Content-Type: application/json; charset=UTF-8

{
  "_v" : "19.1",
  "_type": "catalog_search_result",
  "count" : 2,
  "hits" : [
    {
        "_type": "catalog",
        "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
        "id" : "my-catalog1",
        "name" : "my-name",
        "description" : "my-description",
        "online" : true,
        "creation_date" : 2013-11-18T05:00:00.000Z,
        "root_category" : "root",
        "category_count" : 14,
        "owned_product_count" : 19,
        "assigned_product_count" : 22,
        "recommendation_count" : 20,
        "assigned_sites" : [
            {
                "_type" : "site",
                "customer_list_link" :
                    {
                        "_type" : "customer_list_link",
                        "customer_list_id" : "list1"
                    },
                "description" : "Site's site used for test.",
                "display_name" : "Test site 1",
                "id" : "site-1"
            },
            {
                "_type" : "site",
                "customer_list_link" :
                    {
                        "_type" : "customer_list_link",
                        "customer_list_id" : "list2"
                    },
                "description" : "Site's site used for test 2.",
                "display_name" : "Test site 2",
                "id" : "site-2"
            }
        ] ,
           "link" : "https://example.com/s/-/dw/data/v19_1/catalogs/my-catalog1"
     },
     {
        "_type": "catalog",
        "_resource_state" : "y4ad025da50d1af6cac62e86de2b13def45ead81ffb01c407dad2dc4bfd438kl",
        "id" : "my-catalog2",
        "name" : "my-name",
        "description" : "my-description",
        "online" : true,
        "creation_date" : 2015-11-18T05:00:00.000Z,
        "root_category" : "root",
        "category_count" : 15,
        "owned_product_count" : 16,
        "assigned_product_count" : 12,
        "recommendation_count" : 0,
        "assigned_sites" : [
              {
                "_type" : "site",
                "customer_list_link" :
                    {
                        "_type" : "customer_list_link",
                        "customer_list_id" : "list2"
                     },
                "description" : "Site's site used for test 2.",
                "display_name" : "Test site 2",
                "id" : "site-2"
              }
        ],
        "link" : "https://example.com/s/-/dw/data/v19_1/catalogs/my-catalog2"
    }
  ],
  "query" : 
  { 
      "term_query": 
      { 
         "fields" : ["is_storefront_catalog"], 
         "operator" : "is",
         "values" : [true]
      } 
  },
  "select": "**",
  "start" : 0,
  "total" : 2
}