...
Numberedheadings |
---|
The Optimizer API is implemented as Apex class and is exposed as REST web service by using Salesforce standard functionality (see Apex Developer Guide for more information). For general information about the Optimizer feature, see Please note that this API does not create the optimizing version record in your instance. To create the necessary records please take a look at the official Salesforce documentation about the creation of records via API: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_composite_sobject_tree_create.htm . REST web serviceURLhttps://<my-domain-name>.my.salesforce.com/services/apexrest/ADvendio/ADvendio__Campaign_Item__c/CreateOptimization/ Method
URL ParamsData ParamsA JSON object with the attribute campaignItems, containing a JSON serialized list of Campaign Items. Example: { "campaignItems":[{<Campaign Item>}, ...]} Success ResponseCode: 200 Content: A JSON serialised Optimization (ADvendio__OptimizingVersion__c) record including all Optimizer Changes (ADvendio__OptimizingChange__c) Error ResponseSee Salesforce Apex REST Documentation LogicWhen creating an Optimization, the Optimizer will create an Optimizing Change record for every single changed field. Optimizing Change contains a reference to the original Campaign Item, the old value, the new value and the developer name of the field. Special cases:
Please note that this API does not create the optimizing version record in your instance. To create the necessary records please take a look at the official Salesforce documentation about the creation of records via API: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_composite_sobject_tree_create.htm . Pseudo code for creating the changes. This should help to collect the data for the insert via salesforce rest api: ExamplesGet a Session-ID
Simple requestA simple request with a Campaign Item to change the Quantity from 1000 to 2000. Call Optimizer web service
|
...