getOffersForMultipleInteractionPoints
getOffersForMultipleInteractionPoints(String
sessionID, String
requestStr)

The getOffersForMultipleInteractionPoints method enables you to request offers from the runtime server for multiple IPs with deduplication.

*
sessionID — a string identifying the current session.
*
requestStr — a string providing an array of GetOfferRequest objects.
Each GetOfferRequest object specifies:
*
ipName — The interaction point (IP) name for which the object is requesting offers
*
*
numberRequested — The number of unique offers it needs for the specified IP
*
offerAttributes — Requirements on the attributes of the delivered offers using an instance of OfferAttributeRequirements
*
duplicationPolicy — Duplication policy ID for the offers that will be delivered
Duplication policies determine whether duplicated offers will be returned across different interaction points in a single method call. ( Within an individual interaction point, duplicated offers are never returned.) Currently, two duplication policies are supported.
*
NO_DUPLICATION (ID value = 1). None of the offers that have been included in the preceding GetOfferRequest instances will be included in this GetOfferRequest instance (that is, Interact will apply de-duplication).
*
ALLOW_DUPLICATION (ID value = 2). Any of the offers satisfying the requirements specified in this GetOfferRequest instance will be included. The offers that have been included in the preceding GetOfferRequest instances will not be reconciled.
The order of requests in the array parameter is also the priority order when offers are being delivered.
For example, suppose the IPs in the request are IP1, then IP2, that no duplicated offers are allowed (a duplication policy ID = 1), and each is requesting two offers. If Interact finds offers A, B, and C for IP1 and offers A and D for IP2, the response will contain offers A and B for IP1, and only offer D for IP2.
Also note that when the duplication policy ID is 1, the offers that have been delivered via an IP with higher priority will not be delivered via this IP.

The getOffersForMultipleInteractionPoints method waits the number of milliseconds defined in the segmentationMaxWaitTimeInMS property for all re-segmentation to complete before running. Therefore, if you call a postEvent method which triggers a re-segmentation or a setAudience method immediately before a getOffers call, there may be a delay.

Return value

The runtime server responds to getOffersForMultipleInteractionPoints with a Response object with the following attributes populated:

*
*
*
*
*
Example

[[replace this getOffers example with getOffersForMultipleInteractionPoints example]]

This example shows requesting a single offer for the Overview Page Banner 1 interaction point and a way to handle the response.

sessionId is the same string to identify the runtime session used by the startSession call which started this session.


String interactionPoint = "Overview Page Banner 1";
int numberRequested=1;

/** Make the call */
response = api.getOffers(sessionId, interactionPoint, numberRequested);

/** Process the response appropriately */
// check if response is successful or not
if(response.getStatusCode() == Response.STATUS_SUCCESS)
{
System.out.println("getOffers call processed with no warnings or errors");

/** Check to see if there are any offers */
OfferList offerList=response.getOfferList();

if(offerList.getRecommendedOffers() != null)
{
for(Offer offer : offerList.getRecommendedOffers())
{
// print offer
System.out.println("Offer Name:"+offer.getOfferName());
}
}
else // count on the default Offer String
System.out.println("Default offer:"+offerList.getDefaultString());
}
else if(response.getStatusCode() == Response.STATUS_WARNING)
{
System.out.println("getOffers call processed with a warning");
}
else
{
System.out.println("getOffers call processed with an error");
}
// For any non-successes, there should be advisory messages explaining why
if(response.getStatusCode() != Response.STATUS_SUCCESS)
printDetailMessageOfWarningOrError("getOffers",
response.getAdvisoryMessages());


IBM Unica Interact
 
8.5.0
For more information, see our support and community site: Customer Central