Catalog Profile API

The Catalog Profile API uses the catalogCode, which is a unique code that identifies a catalog, to generate its data profile and cache it. You define a catalogCode when you create a sales catalog. The data profile of a catalog consists of various details combined into a single object.

The data profile contains such information as:

  • List of offer IDs related to the catalog.

  • Rule sets attached to offers.

  • Metrics:

    • Number of promotions in the catalog.

    • Number of products in the catalog.

    • Number of parent-child items in the catalog.

URI 

/services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/catalogprofile

HTTP Method 

GET

URI Parameters 

If you specify just one of these two parameters, it will follow the behavior described in the following table and accept your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence.

ParameterExampleDefaultOptional/RequiredNotes
effectiveStartTime2001-07-04T12:08:56Current date and timeOptionaleffectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message.
expirationTime2001-07-04T12:08:56effectiveStartTime + TimeToLiveOptionalexpirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days.

Here is an example of how to pass the URI parameters:

1GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/catalogprofile?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56

Remote API 

This is an example of how you invoke the API using Apex:

1String methodName;
2Map<String, Object> input = new Map<String, Object>();
3Map<String, Object> output = new Map<String, Object>();
4Map<String, Object> options = new Map<String, Object>();
5
6// Setting remote parameters
7methodName = 'getCatalogProfile';
8input.put('apiName','CMCatalogProfile'); // required
9input.put('catalogCode', 'TestCatalog'); // required
10input.put('effectiveStartTime', null);   // optional
11input.put('expirationTime', null);       // optional
12input.put('methodName',methodName);      // required
13input.put('requestURL', '/v3/admin/catalogs/TestCatalog/catalogprofile'); // required
14
15//remote action invocation
16vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler();
17appHandler.invokeMethod(methodName, input, output, options);

Parallel Invocation 

This API can be run in parallel for multiple catalogs. For example, if you have 100 catalogs (Catalog1, Catalog2..Catalog 100), you can run the API for all 100 catalogs in 100 parallel threads.

1THREAD1 -  GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/catalogprofile
2THREAD2 -  GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog2/catalogprofile
3......
4THREAD100 -  GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog100/catalogprofile

HTTP Headers 

HeaderDescription
Content-Typeapplication/json

Response Body 

This example shows the JSON of catalog data profile containing the offers and metadata information:

1{
2  "profileType": "catalog",
3  "code": "test",
4  "data": {
5    "sortedCatalogEligibilityObjectListMap": [
6      "01t5w00000FbI08AAF"
7    ],
8    "catalogProductRelationDetails": {
9      "Promotion": [],
10      "Product": [
11        "01t5w00000FbI08AAF"
12      ]
13    },
14    "catalogCodeToRuleAssignments": {},
15    "metrics": {
16      "pcisCount": 0,
17      "promosCount": 0,
18      "prodsCount": 1
19    }
20  }
21}

HTTP Response Codes 

CodeDescription
200OK
500Internal Server Error