You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
GetByPageUrl is working well for me getting view data (GroupTicketResponse). I am also using it to get all tickets in the incremental export (TicketExportResponse).
It is here that I randomly receive "Object reference not set to an instance of an object" on my GetByPageUrl call. So, I've been hyper-vigilant about checking for nulls everywhere, but it still occurs.
Code:
var initialResponse = api.Tickets.GetInrementalTicketExport(startDate);
int totalFetched = 0;
if (initialResponse != null)
{
if (initialResponse.Results != null)
{
eventLog.WriteEntry("Number of tickets in first call to incremental export: " + initialResponse.Results.Count());
totalFetched = initialResponse.Results.Count();
responseList.Add(initialResponse);
var nextPage = initialResponse.NextPage;
if (initialResponse.Results.Count() >= 1000)
{
TicketExportResponse paginationResponse = new TicketExportResponse();
do
{
//sleep
System.Threading.Thread.Sleep(1000 * 65); // 65 seconds (This is necessary as this API call is rate limited)
if (!string.IsNullOrEmpty(nextPage))
{
paginationResponse = api.Tickets.GetByPageUrl<TicketExportResponse>(nextPage.Trim()); //**exception occurs here**
if (paginationResponse != null && !string.IsNullOrEmpty(paginationResponse.NextPage))
{
nextPage = paginationResponse.NextPage;
}
}
if (paginationResponse != null && paginationResponse.Results != null)
{
totalFetched = totalFetched + paginationResponse.Results.Count();
eventLog.WriteEntry("Just fetched another " + paginationResponse.Results.Count() + " records. Total so far: " + totalFetched);
responseList.Add(paginationResponse);
}
} while (paginationResponse != null && paginationResponse.Results != null && paginationResponse.Results.Count >= 1000);
}
}
}
Am I missing something or is there a known issue? It pulls tickets great in batches of 1000 but...every now and again I get the Object Reference exception. It's random.
(I also sometimes get a 502 Bad Gateway and have put in re-try logic for that)
Thanks a lot in advance. Great API you created!
-DCJ
The text was updated successfully, but these errors were encountered:
Hello,
GetByPageUrl is working well for me getting view data (GroupTicketResponse). I am also using it to get all tickets in the incremental export (TicketExportResponse).
It is here that I randomly receive "Object reference not set to an instance of an object" on my GetByPageUrl call. So, I've been hyper-vigilant about checking for nulls everywhere, but it still occurs.
Code:
Am I missing something or is there a known issue? It pulls tickets great in batches of 1000 but...every now and again I get the Object Reference exception. It's random.
(I also sometimes get a 502 Bad Gateway and have put in re-try logic for that)
Thanks a lot in advance. Great API you created!
-DCJ
The text was updated successfully, but these errors were encountered: