getOffers

The getOffers method enables you to request offers from the runtime server.

function callGetOffers(commandsToExecute, callback) {

        var ssId = document.getElementById('go_sessionId').value;
        var ip = document.getElementById('go_ipoint').value;
        var nofRequested = 5 ;
        var nreqString = document.getElementById('offersRequested').value;

        InteractAPI.getOffers(ssId, ip, nofRequested, callback);

}
  • session ID-a string identifying the current session.

  • Interaction point-a string identifying the name of the interaction point this method references.

    Note: This name must match the name of the interaction point defined in interactive channel exactly.
  • nofRequested-an integer identifying the number of offers requested.

  • callback - If the method was successful, the callback function calls onSuccess. If the method failed, the callback function calls onError.

The getOffers 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 getOffers with a Response object with the following attributes populated:

  • AdvisoryMessages
  • ApiVersion
  • OfferList
  • Profile
  • SessionID
  • StatusCode
  • NameValuePair

Decimal places in offer scores are returned in the getOffer response in the NameValue Pair. When offers are returned to the requesting inbound channels, the channels use the scores to prioritize the offers. The decimal digits are not removed, and so the channel knows which offer has a higher score in case decimal numbers are returned.