You may want to know the status of a call while it's in progress. Here is an example of how to do that:
function update(next, delay) {
if (!rcsdk.getRingoutHelper().isInProgress(ringout)) return;
platform.apiCall(rcsdk.getRingoutHelper().loadRequest(prevRingoutData))
.then(function(ajax) {
// also save ajax.data as, for example, prevRingoutData
console.log(ajax.data); // updated status of ringout
timeout = next(delay); // you can increase delay here
})
.catch(handleError);
}
var timeout = rcsdk.getUtils().poll(update, 3000); // stay in RPS limits
To stop polling:
rcsdk.getUtils().stopPolling(timeout);