demellor

GetUpdatedPackagesWithinDateRange .NET 11.35 Public Sandbox

0 votes

Using the code below I only get 1 package back, but I can tell I should be getting multiple packages with multiple senders based on the date range.  Can someone please tell me what I'm doing wrong?  I don't see it?  Thx       

 

static public readonly DateTime START_DATE = DateTime.Today.AddDays(-120); // DateTime.Now;
        static public readonly DateTime END_DATE = DateTime.Now;


        static private void GetLastUpdate()
        {
            EslClient eslClient = new EslClient(Program.apiKey, Program.apiUrl);
            //OneSpan Sample code - https://community.onespan.com/documentation/onespan-sign/guides/feature-guides/developer/retrieve-list-packages
            PageRequest pageRequest = new PageRequest(1, 100);
            bool hasNext = false;
            do
            {
                Page<DocumentPackage> resultPage = eslClient.PackageService.GetUpdatedPackagesWithinDateRange(DocumentPackageStatus.COMPLETED, new PageRequest(1), START_DATE, END_DATE);
                hasNext = resultPage.HasNextPage();
                pageRequest = pageRequest.Next;
                int i = 0;
                while (i < resultPage.Results.Count)
                {
                    Console.WriteLine("PkgID: " + resultPage.Results[i].Id + "  TransName: " + resultPage.Results[i].Name + "  Sender: " + resultPage.Results[i].SenderInfo.Email + "  Created: " + resultPage.Results[i].CreatedDate);
                    i++;
                }
            } while (hasNext);
        }

Richard DeMello


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off