jump to navigation

Timeout? Nope. TimeIN. July 1, 2008

Posted by mmoriar1 in Uncategorized.
trackback

Since last time, I’ve completed retrieval of tracking events and minimal retrieval of triggered sends.  Some things I’ve encountered that I will talk about in this post:

  • The timeout setting on the PartnerAPIWse object is quite important and crucial to performing many API calls
  • The AJAX calendar extender is a very sleek way for the user to input dates
  • Retrieving tracking events is fairly straightforward, and when retrieving more than 2500 objects, you must check the call’s status for “MoreDataAvailable”
  • It’s much much quicker to retrieve tracking events in bulk and then filter on subscriber locally then to use multiple small retrieves and have the ExactTarget system filter on subscriber key

First I’ll talk about the timeout setting on the PartnerAPIWse object.  Before finding this setting, my API calls would timeout if I was operating on more than ~200 object.  The SOAP envelope was just too big and ExactTarget was dropping it after 90 seconds (the default setting).  After setting the timeout higher, however, I’ve been able to perform create/retrieve/update/delete calls on 12000+ subscriber objects.  So that’s the key to performing calls on a greater number of objects:

PartnerAPIWse integrationFramework = CreatePartnerAPI(usermm, mmpass);
integrationFramework.Timeout = 500000;

You’ve probably used a calendar extender before.  It’s what most travel websites use for their date input fields.  The one that is used in the ASP.NET AJAX Toolkit is pretty much the same as those.  It’s fully customizable, and it’s very easy to use and install.  Link: http://www.asp.net/learn/ajax-videos/video-124.aspx .

When retrieving more than 2500 records, you must keep inspecting the status of the API call to see if it is “MoreDataAvailable”.  Also, I’ve discovered that performing API calls on larger chunks of objects is more efficient than breaking the large group into smaller chunks.  For example, when I created 12000+ subscribers by breaking it up and creating 100 at a time, the total creation time was 28 minutes.  When I created 2500 (the limit) at a time, the creation time was 13 minutes.  These results were fairly repeatable.  Here is some sample code for retrieving all of the clickevents for a send (may total in the millions):

do
{
if (status == “MoreDataAvailable”) request.ContinueRequest = requestID;
status = partnerAPI.Retrieve(request, out requestID, out results);
if (results.Length > 0)
{
Console.WriteLine(“Found {0} ClickEvents”, results.Length.ToString());
blnFoundData = true;
createTSVFile(results);
}
else
{
Console.WriteLine(“No ClickEvents found. Status = ” + status);
}
} while (status == “MoreDataAvailable”); // Get additional results

If I remember anything else, I’ll post it here.

Until next time,

Mike

Advertisements

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: