Sample Implementation to Override the 255-Character Limitation

The Digital Commerce APIs use the vlocity_cmtAPIParamsc field in the vlocity_cmtVlocityAPIMetaDatac sObject to configure request response fields, batch size, and other options. This field is also used to identify certain settings of the API while processing batch jobs or while processing API requests at run time.

However, the vlocity_cmt_APIParams__c field is by default limited to 255 characters. In some scenarios, this can be insufficient. For example, consider the following JSON request for a batch job:

In this example, if you specify multiple fields in productFields, the vlocity_cmt_APIParams__c field might exceed the 255 character limitation. In such cases, to increase the number of characters this field can contain, you can override the default character limitation. To do this, you can create an Apex class along with an interface implementation. For example, create an implementation similar to the following sample.

Sample Implementation Name

DCAPIParamsImplementation

Sample Implementation Method

fetchAPIParamsOverride

Input

KeyTypeDescription
apiNameStringDefines the name of the API from vlocity_cmtVlocityAPIMetaDatac.vlocity_cmtAPINamec
paramsStringDefines the parameters of the given API name. This represents vlocity_cmtVlocityAPIMetaDatac.vlocity_cmtVlocityAPIMetaDatac

Output

KeyTypeDescription
resultStringUpdates the API parameters for the given API name.

Sample Implementation