Performing a Paginated Product Search

You use this Siebel REST API to search products starting at a row number, and to return only a limited number of records that are specified in the input. This executes the search on products using the input search option, such as product class, class attributes, attribute constraints, pricing criteria, and so on. This search generates output in pages corresponding to the information requested in the input, which enables you to present information in a structured format.

Two types of search are supported: SearchByProduct and SearchByClass. SearchOption is a required input to indicate the type of search required.

The following request returns a list of products that belong to a promotion aggregate rule, while checking eligibility on the list of products:

  • URI: http://ServerName:port/siebel/v1.0/service/PDS Product Data Service/ExecuteSearch

  • HTTP Method: POST

  • Content-Type: application/json

  • Authorization: Basic

  • Request body:
     	{
    	"body": {
    		"EligibilityMode": "0",
    		"PricingMode": "N",
    		"PageSize": "4",
    		"RecordCountNeeded": "True",
      "ContextMode": "SiebelContext",
    		"StartRowNum": "0",
    		"SearchOption": "SearchByClass",
    		"Context": {
    			"MessageId": "",
    			"IntObjectName": "PDS Catalog Context",
    			"MessageType": "Integration Object",
    			"ListOfPDS Catalog Context": {
    				"Context": {
    					"ListOfSiebel Context": {
    						"Siebel Context": {
    							"BusObjName": "Quote",
    							"ContextRowId": "0V-1706Z7",
    							"SignalMode": "Quote",
    							"BusCompName": "Quote"
    						}
    					}
    				}
    			}
    		},
    		"ClassAttributes": {
    			"MessageId": "",
    			"IntObjectName": "PDS Product Class Attributes Interface",
    			"MessageType": "Integration Object",
    			"ListOfPDS Product Class Attributes Interface": {
    				"ISS PS Direct Subclass": {
    					"Class Id": "88-1WVXT7",
    					"ListOfISS Class Attribute": {
    						"ISS Class Attribute": {
    							"Display Name": "Attr1",
    							"Value": "0"
    						}
    					}
    				}
    			}
    		}
    	}
    }
    

For a description of the request message associated with this API, see the following table.

Name Description

SearchOption

One of the following input arguments is required:
  • SearchByProduct. This is an instance of the integration object PDS Product Interface.

  • SearchByClass. This is an instance of the integration object PDS Product Class Attributes Interface.

    You must specify class ID, attribute ID, and attribute value in an attribute list of value structure. That is, an array with one element for either a freeform, or a list of value, type attribute.

PricingMode

Optional. Valid values are N or Y, and the default value is Y.

This determines if a price calculation is made.

EligibilityMode

Optional. Valid values are 0, 1, or 2.

  • If set to 0, then the procedure is not run.

  • If set to 1, then the procedure is run, and all ineligible products are displayed with messages.

  • If set to 2, then the procedure is run, and ineligible products are not included in the pricing calculations.

ContextMode

Optional. However, if this is not provided then pricing and eligibility are not processed.

Valid values are:
  • SiebelContext. Uses existing Quote and Order information from the Siebel database. The API then constructs the context using the provided row ID.

  • ExternalContext. The external call provides the context information. The API then passes this information to the pricing and eligibility processes.

Context

Required. However, this is optional if ContextMode is not provided.

This is an instance of the integration object PDS Catalog Context. It either contains SiebelContext or ExternalContext.

PriceSearchExpression

Optional.

The expression for performing a price search. For example, searching for a price that is greater than 100 and less than 1000.

ProductSearchSpec

Optional.

This is the search specification for a product business component, for example: [Name] like "Oracle*"

ResultSize

Optional. The default value is 100.

The number of products returned.

StartRowNum

Optional. The default value is 0.

Starting row number.

PageSize

Optional.

Number of records to be returned.

RecordCountNeeded

Optional.

Valid values are TRUE or FALSE.

RecordCount

This is search output.

If the value of RecordCountNeeded is TRUE, then this parameter returns the total number of records returned as defined by the search specification.

LastPage

This is search output.

Indicates with the values TRUE or FALSE if the row set is the last.

Here are the response details for a successful request:

  • HTTP Code: 200

  • Content-Type: application/json

  • Response body:
        	            {{
    	"LastPage": "False",
    	"RecordCount": "10",
    	"SiebelMessage": {
    		"IntObjectFormat": "Siebel Hierarchical",
    		"MessageId": "",
    		"IntObjectName": "PDS Product Interface",
    		"MessageType": "Integration Object",
    		"Product": [
    			{
    				"Name": "TestPr1",
    				"Product Type Code": "Product"
    			},
    			{
    				"Name": "TestPr10",
    				"Product Type Code": "Product"
    			},
    			{
    				"Name": "TestPr2",
    				"Product Type Code": "Product"
    			},
    			{
    				"Name": "TestPr3",
    				"Product Type Code": "Product"
    			}
    		]
    	}
    }