CategoryProductAssignmentSearch resource (Data API 23.2)
Summary
| Http Method | Resource | Description | 
|---|---|---|
| POST | /catalogs/{catalog_id}/categories/{category_id}/category_product_assignment_search | 
 Searches for category product assignments. The query attribute specifies a complex query that can be used to narrow down the search. This is the list of searchable attributes: 
 Sortable Fields: 
 Expansions that can be applied for the search request: 
  | 
Search Category Product Assignment
Searches for category product assignments.
The query attribute specifies a complex query that can be used to narrow down the search. This is the list of searchable attributes:
- product_id - String
 - product_name - String
 - online_flag - Boolean
 - searchable - Boolean
 - valid_from - DateTime
 - valid_to - DateTime
 - creation_date - DateTime
 
Sortable Fields:
- product_id - String
 - product_name - String
 - position - Double
 - creation_date - DateTime
 
Expansions that can be applied for the search request:
- product_base - String - This expand will enable retrieval of the following basic Product information:
 - product_images - String - to fetch preview image and image groups specified for the given product
 - product_all_images - String - to fetch preview image and image groups specified for the product plus images for its variants and variation groups
 - product_variations - String to fetch variations related information, version 17.8+
 - product_availability - String to fetch availability related information, version 17.8+
 - product_categories - String to fetch category related information, version 17.8+
 - product_prices - String to fetch prices related information, version 17.8+
 - product_options - String to fetch options related information, version 17.8+
 - 
product_all - String to fetch all expanded information, version 17.8+
- brand
 - ean
 - link
 - long_description
 - manufacturer_name
 - manufacturer_sku
 - name
 - page_description
 - page_keywords
 - page_title
 - searchable
 - short_description
 - type
 - unit
 - upc
 
 
Url
POST https://hostname:port/dw/data/v23_2/catalogs/{catalog_id}/categories/{category_id}/category_product_assignment_search?site_id={String}
Formats
json, xml
Authentication
| Name | Description | 
|---|---|
| OAuth | Authentication via OAuth token. | 
Request Document
CategoryProductAssignmentSearchRequest
Response Document
CategoryProductAssignmentSearchResult
Path Parameters
| Parameter | Type | Description | Constraints | 
|---|---|---|---|
| catalog_id | String | The id of the catalog. | minLength=1 | 
| category_id | String | The id of the category. | minLength=1 | 
Query Parameters
| Parameter | Type | Description | Constraints | 
|---|---|---|---|
| site_id | String | The site context. | 
In case of a failure Fault Document is returned.
Faults
| Status | Type | Arguments | Description | 
|---|---|---|---|
| 400 | MalformedSearchParameterException | 
Thrown if the query is ill-formed. | |
| 404 | CategoryNotFoundException | 
 catalogId (String) categoryId (String)  | 
Thrown if the category does not exist matching the given catalog_id. | 
| 404 | CatalogNotFoundException | 
 catalogId (String)  | 
Thrown if the catalog does not exist matching the given category_id. | 
Sample
REQUEST:
POST /s/-/dw/data/v23_2/catalogs/SampleCatalog/categories/SampleCategory/category_product_assignment_search HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Accept: application/json
{
    "query":
         {"text_query": { "fields": ["product_id"], "search_phrase": "sample_product"} },
           "select": "(**)",
            "expand": ["product_base"]
         },
        "select" : "(**)"
}
RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
  {
   "_v" : "23.2",
   "_type" : "category_product_assignment_search_result",
   "count" : 2,
   "hits" : 
   [
      
      {
         "_type" : "category_product_assignment",
         "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
         "catalog_id" : "SampleCatalog",
         "category_id" : "SampleCategory",
         "link" : "https://example.com/s/-/dw/data/v23_2/catalogs/SampleCatalog/category_product_assignments/SampleCategory/sample_product1",
         "owning_catalog_name" : 
         {
            "default" : "Apparel Main Catalog"
         },
         "position" : 1.0,
         "product" : 
         {
            "_type" : "product",
            "id" : "sample_product",
            "link" : "https://example.com/s/-/dw/data/v23_2/products/sample_product1",
            "long_description" : 
            {
               "default" : "We took this classic crew neck and updated it with jewels and embroidery."
            },
            "name" : 
            {
               "default" : "Long Sleeve Appliqued Crew Neck"
            },
            "online" : true,
            "page_description" : 
            {
               "default" : "We took this classic crew neck and updated it with jewels and embroidery."
            },
            "page_title" : 
            {
               "default" : "Long Sleeve Appliqued Crew Neck"
            },
            "searchable" : true,
            "short_description" : 
            {
               "default" : "We took this classic crew neck and updated it with jewels and embroidery."
            },
            "type" : 
            {
               "_type" : "product_type",
               "variant" : true
            },
            "upc" : "701642824237"
         },
         "product_id" : "sample_product1"
      },
      {
         "_type" : "category_product_assignment",
         "_resource_state" : "y4ad025da50d1af6cac62e86de2b13def45ead81ffb01c407dad2dc4bfd438kl",
         "catalog_id" : "SampleCatalog",
         "category_id" : "SampleCategory",
         "link" : "https://example.com/s/-/dw/data/v23_2/catalogs/SampleCatalog/category_product_assignments/SampleCategory/sample_product2",
         "owning_catalog_name" : 
         {
            "default" : "Apparel Main Catalog"
         },
         "position" : 2.0,
         "product" : 
         {
            "_type" : "product",
            "id" : "008884304023",
            "link" : "https://example.com/s/-/dw/data/v23_2/products/sample_product2",
            "long_description" : 
            {
               "default" : "Love our easy care solid shirting? Then give our stripes a try! This subtle blue stripe is a nice option to have in your closet for workplace wear and it even has a bit of stretch for extra comfort."
            },
            "name" : 
            {
               "default" : "Platinum Blue Stripes Easy Care Fitted Shirt "
            },
            "online" : true,
            "page_description" : 
            {
               "default" : "Love our easy care solid shirting? Then give our stripes a try! This subtle blue stripe is a nice option to have in your closet for workplace wear and it even has a bit of stretch for extra comfort."
            },
            "page_title" : 
            {
               "default" : "Platinum Blue Stripes Easy Care Fitted Shirt "
            },
            "searchable" : true,
            "short_description" : 
            {
               "default" : "Love our easy care solid shirting? Then give our stripes a try! This subtle blue stripe is a nice option to have in your closet for workplace wear and it even has a bit of stretch for extra comfort."
            },
            "type" : 
            {
               "_type" : "product_type",
               "variant" : true
            },
            "upc" : "008884304023"
        },
         "product_id" : "sample_product2"
      },
  ],
  "query" : { "text_query": { "fields": ["id"], "search_phrase": "sample_product" } },
  "select": "**",
  "start" : 0,
  "total" : 2
}
# in case of failure:
 
RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "CatalogNotFoundException",
      "message" : "No catalog with ID 'SampleCatalog' was found."
   }
}
RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "CategoryNotFoundException",
      "message" : "No category with ID 'SampleCategory' for catalog 'SampleCatalog' was found."
   }
}
RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "SiteNotFoundException",
      "message" : "No site with ID 'nonexisting' was found."
   }
}