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.

important: Ensure you run generateAction before you run regenerateAction.

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 itemType Priority
dataProfileResultItem 1
ruleSetCombinationResultItem 2
contextDimensionsResultItem 3
contextCombinationsResultItem 4
catalogCtxEligibilityResult 5
offerItem 6
hierarchyResult 8
priceResult 9
itemDetails 10
bundleWrapper 11
promotionWrapper 11
item 12
orderConfiguration 13

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}

Parameter Example Optional/Required Description
ChangeEntryId a525g000000CjVbAAK Required CachedAPIChangeEntry 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 Fields Description
requestBody Indicates if there are any request bodies to provide in the respective API.
params Indicates if there are any query parameters to provide in the respective API.
link Specifies the API URI to invoke the service.
method Indicates 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.

{
  "regenerateAction": {
    "bundleWrapper": {
      "rest": {
        "requestBody": {

        },
        "params": {
          "forceinvalidatecache": true,
          "ChangeEntryId": "a525g000000CjVbAAK"
        },
        "link": "/v3/admin/catalogs/mobiles/offers/01t4W00000BgarjQAB/bundlewrapper",
        "method": "POST"
      }
    }
  }
}

Sample Input for offersItem Regeneration

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

{ "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.

{
    "Sequence": 8,
    "regenerateAction": {
        "hierarchy": {
            "rest": {
                "requestBody": {},
                "params": {
                    "forceinvalidatecache": true,
                    "ChangeEntryId": "a4P5g000000xDljEAE"
                },
                "link": "/v3/admin/catalogs/CM_CAT/offer/01t5g0000008VjRAAU/hierarchy",
                "method": "POST"
            }
        }
    }
}

Sample Input for prices Regeneration

To invoke this action node, see Prices APIPrices API.

{
    "Sequence": 8,
    "regenerateAction": {
        "prices": {
            "rest": {
                "requestBody": {},
                "params": {
                    "forceinvalidatecache": true,
                    "ChangeEntryId": "a4P5g000000xDloEAE"
                },
                "link": "v3/admin/catalogs/CM_CAT/offers/01t5g0000008VjRAAU/prices",
                "method": "POST"
            }
        }
    }
}

Sample Input for getOffers Regeneration

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

{
      "Sequence": 7,
      "regenerateAction": {
        "getOffers": {
          "rest": {
            "requestBody": null,
            "params": {
              "pagesize": "20",
              "offset": "0",
              "context": "{\"AF\":\"false\",\"AT\":\"false\"}",
              "ChangeEntryId": "a525g000000CjaBAAS",
              "forceinvalidatecache": true
            },
            "link": "/v3/catalogs/CM_CAT_B/offers",
            "method": "GET"
          }
        }
      }
    }
 }

Sample Input for getOffersDetails Regeneration

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

{
      "Sequence": 9,
      "regenerateAction": {
        "getOfferDetails": {
          "rest": {
            "requestBody": null,
            "params": {
              "forceinvalidatecache": true,
              "ChangeEntryId": "a525g000000CjVaAAK",
              "context": "{\"AF\":\"true\",\"AT\":\"true\"}"
            },
            "link": "/v3/catalogs/CM_CAT/offers/POPA",
            "method": "GET"
          }
        }
      }
    }
}

Sample Input for invalidateAction Node

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

{
      "invalidateAction": {
        "invalidateCachedResponse": {
          "rest": {
            "requestBody": {
              "cachedAPIResponseIds": [
                "a0a5g0000005JbKAAU",
                "a0a5g0000005JaGAAU",
                "a0a5g0000005JbTAAU",
                "a0a5g0000005JbUAAU",
                "a0a5g0000005JbVAAU",
                "a0a5g0000005JbWAAU"
              ]
            },
            "params": {

            },
            "link": "/v3/admin/catalogs/regenerate/invalidate",
            "method": "POST"
          }
        }
      }
    }

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.

{
    "generateAction": {
    "catalogCodes": [
        "CM_CAT_B",
        "CM_CAT"
    ],
    "apiNames": [
        "catalogprofile",
        "rulesetcombinations",
        "contextdimensions",
        "contextcombinations",
        "contexteligibility"
    ]
    }
}

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.

THREAD1 -  regenerateCacheObject(REGEN_ACTION1.CACE1)
THREAD2 -  regenerateCacheObject(REGEN_ACTION2.CACE2)
THREAD3 -  regenerateCacheObject(REGEN_ACTION3.CACE3)
.
.
.
.
THREAD100 -  regenerateCacheObject(REGEN_ACTION100.CACE100)

HTTP Headers

Header Description
Content-Type application/json

HTTP Response Codes

Code Description
200 OK
500 Internal Server Error