demellor

Page Size now Limited

0 votes

I had API code below that used a PullPageSize of 500 and worked fine, but with the OneSpan updates that returns a null pointer.  I can use 100 without a problem.  

 

Why was the size limited?  What is the limit?  Using 100 make my retrievals MUCH slower

 

PageRequest npr = new PageRequest(i, PullPageSize);

Richard DeMello


Reply to: Page Size now Limited

0 votes

Hi Richard,

 

Thanks for your post! 

For most of the OSS APIs (e.g. get packages, get templates), the page size is always 100. 

The exception here is the latest transaction summary API which allows to return at most 1000 items in one call. However this API wasn't supported by SDK yet, were you using Restful code to invoke this API?

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Page Size now Limited

0 votes

I'm using the .NET libraries to access the API to make the call - not sure what the .NET calls underneath

Richard DeMello


Reply to: Page Size now Limited

0 votes

Could you share some code snippets around the methods?

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Page Size now Limited

0 votes

   public static string GetSenderID(string sendereMail)
       {//Load and Cache them to speed up searches possibly
           const int PullPageSize = 100; //was 500 but that now returns a null ptr?
           try
           {
               OssClient oClient = new OssClient(GlobalVars.CurrentapiKey, GlobalVars.CurrentapiUrl);
               int i = 1;
               PageRequest npr = new PageRequest(i, PullPageSize);
               IDictionary<string, Sender> accountMembers = oClient.AccountService.GetSenders(Direction.ASCENDING, npr);
               while (accountMembers.Count != 0)
               {
                   foreach (var s in accountMembers)
                   {
                       string email = s.Key.ToString().ToUpper();
                       string id = s.Value.Id;
                       //Console.WriteLine(email + " " + id);
                       if (email.Equals(sendereMail.ToUpper()))
                           return id.ToString();
                       i++;
                   }
                   PageRequest npr2 = new PageRequest(i, PullPageSize);
                   accountMembers = oClient.AccountService.GetSenders(Direction.ASCENDING, npr2);
               }
           }

           catch (System.Net.WebException ex)
           {
               Console.WriteLine("GetSenderID ERROR - " + ex.Message);
               return "";
           }
           return "";
       }

Richard DeMello


Reply to: Page Size now Limited

0 votes

I see, oClient.AccountService.GetSenders() method (API here) is a bit different in terms of the return items. Let me do some tests and will come back to you.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Page Size now Limited

0 votes

I was testing with a us2 sandbox account which has 1k senders, and can successfully receive the response with 500 page limit, see the screenshot.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Attachments

Reply to: Page Size now Limited

0 votes

We are FedRAMP.  I'll try again with 500 and let you know what happens and provide a screen shot if it fails.

Richard DeMello


Reply to: Page Size now Limited

0 votes

Here is my failure with a screen shot :)  Still fails at 300 - 500, but works at 100-200

Richard DeMello


Reply to: Page Size now Limited

0 votes

Hi Richard,

 

Can I also have the trace of the error of which line returns this null pointer?

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


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