Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<br><br>
<table border="1">
<tr>
<th>Ordinal</th>
<th>SendID</th>
<th>SubscriberKey</th>
<th>Eventhate</th>
<th>EventType</th>
<th>TriggeredSendDefinitionObjectID</th>
<th>BatchID</th>
<th>ClientID</th>
</tr>
<script runat="server">
Platform.Load("Core","1.1.1");
try{
var prox = new Script.Util.WSProxy(),
objectType = "BounceEvent",
cols = [
"SendID",
"SubscriberKey",
"EventDate",
"EventType",
"TriggeredSendDefinitionObjectID",
"BatchID",
"Client.ID"
],
filter = {Property: "EventDate", SimpleOperator: "between", Value: ["2016-01-01T03:00:00.000Z", "2017-02-02T02:59:59.999Z"]},
moreData = true,
reqID = null,
numItems = 0;
while(moreData) {
moreData = false;
var data = reqID == null ?
prox.retrieve(objectType, cols, filter):
prox.getNextBatch(objectType, reqID);
if(data != null) {
moreData = data.HasMoreRows;
reqID = data.RequestID;
if(data && data.Results) {
for(var i=0; i< data.Results.length; i++) {
var j = +i +1
Write("<tr>");
Write("<td>" + j + "</td>");
Write("<td>" + data.Results[i].SendID + "</td>");
Write("<td>" + data.Results[i].SubscriberKey + "</td>");
Write("<td>" + data.Results[i].EventDate + "</td>");
Write("<td>" + data.Results[i].EventType + "</td>");
Write("<td>" + data.Results[i].TriggeredSendDefinitionObjectID + "</td>");
Write("<td>" + data.Results[i].BatchID + "</td>");
Write("<td>" + data.Results[i].Client.ID + "</td>");
Write("</tr>");
numItems++;
}
}
}
}
Platform.Response.Write("<b><br>" + numItems + " total " + objectType + ":<br><br></b>");
}catch(e){
Write(Stringify(e));
}
</script>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.