Regenerate Affected Response API

As part of the regeneration of records, a cachedAPIChangeEntryId query parameter regenerates the cache data for the change entry Id passed in the input.

Ensure you run generateAction before you run regenerateAction.

Important

The Regenerate Affected Response API:

  • Checks if the Id is valid and the corresponding cachedAPIChangeEntryId record is unprocessed.

  • Gets the cachedAPIchange Id and checks if the dependent change entry is processed. If not, then the API throws an error to indicate that the dependent records are not processed.

  • If regeneration is successful, the API marks the cachedAPIChangeEntryId record as processed.

This is the predefined sequence for specific types of records to regenerate:

Sequence for the itemTypePriority
dataProfileResultItem1
ruleSetCombinationResultItem2
contextDimensionsResultItem3
contextCombinationsResultItem4
catalogCtxEligibilityResult5
offerItem6
hierarchyResult8
priceResult9
itemDetails10
bundleWrapper11
promotionWrapper11
item12
orderConfiguration13

For example, if you execute changeEntryId for bundle wrapper with sequence 11, but there is an unprocessed ChangeEntryId in the cachedAPIChange entry table for itemDetails with sequence 10 for the same offer, then an error occurs for violating the dependency check. You can obtain the ChangeEntryId required as a query parameter in the API from the Affected Cache API records.regenerateAction.bundleWrapper.params.ChangeEntryId node.

RegenerateAction nodes with the same sequence can be executed in parallel.

URI Parameters for regenerateAction Node 

For example: POST /v3/admin/catalogs/{value}/offers/{value}/{APIname}?ChangeEntryId={value}

ParameterExampleOptional/RequiredDescription
ChangeEntryIda525g000000CjVbAAKRequiredCachedAPIChangeEntry Id that verifies the dependency check and tracks the generation or regeneration of the API. Contains the Id of the CachedAPIChange Entry object to process.

Action Nodes 

An action node contains the request format in the REST Node. These are the action node fields:

Action Node FieldsDescription
requestBodyIndicates if there are any request bodies to provide in the respective API.
paramsIndicates if there are any query parameters to provide in the respective API.
linkSpecifies the API URI to invoke the service.
methodIndicates if the respective API is a GET or POST request.

Sample Input for bundleWrapper Regeneration 

To invoke this action node, see Bundle Wrapper APIBundle Wrapper API.

1{
2  "regenerateAction": {
3    "bundleWrapper": {
4      "rest": {
5        "requestBody": {
6
7        },
8        "params": {
9          "forceinvalidatecache": true,
10          "ChangeEntryId": "a525g000000CjVbAAK"
11        },
12        "link": "/v3/admin/catalogs/mobiles/offers/01t4W00000BgarjQAB/bundlewrapper",
13        "method": "POST"
14      }
15    }
16  }
17}

Sample Input for offersItem Regeneration 

To invoke this action node, see Offers Item APIOffers Item API.

1{ "Sequence": 6, "regenerateAction": { "offersItem": { "rest": { "requestBody": { "offerIds": [ "01t5g000001q3wWAAQ" ] }, "params": { "ChangeEntryId": "a525g000000CjbQAAS", "forceinvalidatecache": true, }, "link": "/v3/admin/catalogs/CM_CAT_B/offersitem", "method": "POST" } } } }

Sample Input for hierarchy Regeneration 

To invoke this action node, see Hierarchy APIHierarchy API.

1{
2    "Sequence": 8,
3    "regenerateAction": {
4        "hierarchy": {
5            "rest": {
6                "requestBody": {},
7                "params": {
8                    "forceinvalidatecache": true,
9                    "ChangeEntryId": "a4P5g000000xDljEAE"
10                },
11                "link": "/v3/admin/catalogs/CM_CAT/offer/01t5g0000008VjRAAU/hierarchy",
12                "method": "POST"
13            }
14        }
15    }
16}

Sample Input for prices Regeneration 

To invoke this action node, see Prices APIPrices API.

1{
2    "Sequence": 8,
3    "regenerateAction": {
4        "prices": {
5            "rest": {
6                "requestBody": {},
7                "params": {
8                    "forceinvalidatecache": true,
9                    "ChangeEntryId": "a4P5g000000xDloEAE"
10                },
11                "link": "v3/admin/catalogs/CM_CAT/offers/01t5g0000008VjRAAU/prices",
12                "method": "POST"
13            }
14        }
15    }
16}

Sample Input for getOffers Regeneration 

To invoke this action node, see getOffers APIGet Offers by Catalog API.

1{
2      "Sequence": 7,
3      "regenerateAction": {
4        "getOffers": {
5          "rest": {
6            "requestBody": null,
7            "params": {
8              "pagesize": "20",
9              "offset": "0",
10              "context": "{\"AF\":\"false\",\"AT\":\"false\"}",
11              "ChangeEntryId": "a525g000000CjaBAAS",
12              "forceinvalidatecache": true
13            },
14            "link": "/v3/catalogs/CM_CAT_B/offers",
15            "method": "GET"
16          }
17        }
18      }
19    }
20 }

Sample Input for getOffersDetails Regeneration 

To invoke this action node, see getOffersDetails APIGet Offer Details API.

1{
2      "Sequence": 9,
3      "regenerateAction": {
4        "getOfferDetails": {
5          "rest": {
6            "requestBody": null,
7            "params": {
8              "forceinvalidatecache": true,
9              "ChangeEntryId": "a525g000000CjVaAAK",
10              "context": "{\"AF\":\"true\",\"AT\":\"true\"}"
11            },
12            "link": "/v3/catalogs/CM_CAT/offers/POPA",
13            "method": "GET"
14          }
15        }
16      }
17    }
18}

Sample Input for invalidateAction Node 

To invoke this action node, see Invalidate Affected Response APIInvalidate Affected Response API.

1{
2      "invalidateAction": {
3        "invalidateCachedResponse": {
4          "rest": {
5            "requestBody": {
6              "cachedAPIResponseIds": [
7                "a0a5g0000005JbKAAU",
8                "a0a5g0000005JaGAAU",
9                "a0a5g0000005JbTAAU",
10                "a0a5g0000005JbUAAU",
11                "a0a5g0000005JbVAAU",
12                "a0a5g0000005JbWAAU"
13              ]
14            },
15            "params": {
16
17            },
18            "link": "/v3/admin/catalogs/regenerate/invalidate",
19            "method": "POST"
20          }
21        }
22      }
23    }

Sample Input for generateAction Node 

To invoke this action node and execute the APIs listed in apiNames in the generateAction node for the list of catalogCodes, see the list of Populate Cache APIsPopulate Cache APIs.

1{
2    "generateAction": {
3    "catalogCodes": [
4        "CM_CAT_B",
5        "CM_CAT"
6    ],
7    "apiNames": [
8        "catalogprofile",
9        "rulesetcombinations",
10        "contextdimensions",
11        "contextcombinations",
12        "contexteligibility"
13    ]
14    }
15}

Parallel Invocation 

Each regenerateActionNode retrieved from the GET Affected Cache API contains a cachedAPIChangeEntryId that can pass and execute in parallel if the dependent entry is processed.

For example, if there are 100 Regenerate Action nodes from the Get Affected Cache API (REGEN_ACTION1, REGEN_ACTION 2…REGEN_ACTION100) and each action node contains a cachedAPIChangeEntryId, such as REGEN_ACTION1.CACE1, then you can run parallel threads of regenerateAction nodes and execute corresponding APIs.

1THREAD1 -  regenerateCacheObject(REGEN_ACTION1.CACE1)
2THREAD2 -  regenerateCacheObject(REGEN_ACTION2.CACE2)
3THREAD3 -  regenerateCacheObject(REGEN_ACTION3.CACE3)
4.
5.
6.
7.
8THREAD100 -  regenerateCacheObject(REGEN_ACTION100.CACE100)

HTTP Headers 

HeaderDescription
Content-Typeapplication/json

HTTP Response Codes 

CodeDescription
200OK
500Internal Server Error