...
Note |
---|
In order to use the Forecast API, your Salesforce Org needs to have API usage activated through having an API usage License. We also recommend you to automate the OAuth access to avoid authorization issues: 1.6 How to authenticate / authorize ADvendio Gateway for the use of our Third Party System integrations? - Authorize ADvendio message / OAuth#Setup: |
Numberedheadings | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||
The Forecast API function 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 Forecast API feature, see REST web serviceURLhttps://<my-domain-name>.my.salesforce.com/services/apexrest/ADvendio/ADvendio__Campaign_Item__c/CheckAvailability/ https://<my-domain-name>.my.salesforce.com/services/apexrest/ADvendio/ADvendio__Campaign_Item__c/JobUpdates/ Method
URL Params
Data ParamsA JSON object with the attribute campaignItems, containing a JSON serialized list of Campaign Items. Example: { "campaignItems":[{<Campaign Item>}, ...]} See Success ResponseCode: 200 Content: A JSON serialized list of the Campaign Items from the request body, but now with updated availability and status fields. Example: [{<Campaign Item>}, ...] Error ResponseSee Salesforce Apex REST Documentation LogicThe CheckAvailability web service function returns the availabilities for all Campaign Items not connected to an Ad Server and starts the availability check for the Campaign Items that are connected to an Ad Server. If an availability check job was started the job information will be saved to the field ADvendio__MostRecentGatewayJobInformation__c. The returned Campaign Item can now be used to get the job results by using the JobUpdates function. The following fields are updated by the CheckAvailability or JobUpdates function.
ExamplesGet a Session-IDGet CLIENT_ID and CLIENT_SECRET from any connected app or create a new app in your org: App Manager -> New Connected App Enable Enable OAuth Settings to see the consumer key (CLIENT_ID) and Consumer Secret (CLIENT_SECRET) Minimal requestA simple request for a Campaign Item connected to an Ad Server (Google Ad Manager, other Ad Server may need additional information). For CheckAvailability the following fields are required per Campaign Item: ADvendio__from_Date__c, ADvendio__until_Date__c, ADvendio__Ad_Price__c Second call to get the job results some time later: For the JobUpdates request the field ADvendio__MostRecentGatewayJobInformation__c is required. This contains the jobId and dummy campaignItemId to map the results back to each Campaign Item. Request with some targetingA request for a Campaign Item connected to an Ad Server including some targeting information. To simplify this, we're using Targeting Sets, which contain all Targeting Criteria. You will need to create those in advance in Salesforce. See Second call to get the job results some time later: Request for non adserver Campaign Items with ContentA request for a Campaign Item not connected to an Ad Server with selected Content. This will start the Exclusivity Check process inside of ADvendio instead of the Check Availability against the AdServer Gateway. Request for non adserver Campaign Items with Content (Inventory Forecast)A request for a Campaign Item not connected to an Ad Server with selected Content. This will start the Exclusivity Check process inside of ADvendio instead of the Check Availability against the AdServer Gateway. Usage in Apex |
...