/
Package Creation API (available from version 2.173 onwards)

Package Creation API (available from version 2.173 onwards)

In order to use this API, your Salesforce Org needs to have API usage activated through having an API usage License. 

1. REST Web Service

1.1. URL

https://<my-domain-name>.my.salesforce.com/services/apexrest/ADvendio/ADvendio__Campaign_Item__c/PackageService/

1.2. Method

PATCH

1.3. URL Params

None

1.4. Data Params

A JSON object with the attribute request, containing mediaCampaignId and a JSON serialized list of campaignItems.

Example:

{ "mediaCampaignId": "a235t000000yMAZAA2", "campaignItems": [ { "Ad_Price__c": "a0T5t000001QpPYEA0", "from_Date__c": "20-01-01", "until_Date__c": "20-01-01", "Rate_Discount_4__c": 4.2, "Quantity__c": 3 }, { "Ad_Price__c": "a0T5t000001QpQNEA0", "from_Date__c": "20-01-01", "until_Date__c": "30-01-01", "Quantity__c": 44, "Id": "a0wXX00XX000000001" }, { "Ad_Price__c": "a0T5t000001QpPgEAK", "from_Date__c": "21-01-01", "until_Date__c": "29-01-01", "Quantity__c": 53, "PacketItem__c": "a0wXX00XX000000001" } ] } }

1.5. Success Response

  • Code: 200

  • Content: A JSON serialized list of the Campaign Items from the request body with their details.

Example:

[ { "attributes": { "type": "ADvendio__Campaign_Item__c", "url": "/services/data/v59.0/sobjects/ADvendio__Campaign_Item__c/a0wXX00XX000000006" }, "ADvendio__Ad_Price__c": "a0T5t000001QpPYEA0", "from_Date__c": "2020-01-01", "until_Date__c": "2020-01-01", "Rate_Discount_4__c": 4.2, "Quantity__c": 3 }, ... ]

1.6. Error Response

See Salesforce Apex REST Documentation

1.8. Examples

1.8.1. Simple Request

Creating a Standard Campaign Item and a Package with a Header and Component: