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