Results 1 to 5 of 5

Thread: Pagination in the REST API

  1. #1
    Join Date
    Feb 2009
    Location
    Perth, Western Australia
    Posts
    1,430

    Default Pagination in the REST API

    Just wondering if anyone has implemented a pagination system in their REST services e.g.


    Code:
    http://localhost/WebOrder_19_1/customerAPI/customers?page=2
    Kind regards,

    Clive Richmond
    Triumph Business Systems Pty Ltd
    www.triumph.com.au

  2. #2
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    1,998

    Default Re: Pagination in the REST API

    Clive

    I actually built a way to do something like this into my RESTLibrary, but without checking quite a bit I can't remember the exact mechanism...

    It was something like:
    Code:
    http://localhost/WebOrder_19_1/API/customers?start=21&limit=20
    Which (maybe if you'd put a bit of extra work in I suspect) would return customer rows from 21 to 40 in the list. Doing it with page=x would require also specifying a page size in rows (which could also be implemented). I know I demoed it doing something like this, maybe in Edinburgh.

    Mike

  3. #3
    Join Date
    Feb 2009
    Location
    South Florida
    Posts
    4,681

    Default Re: Pagination in the REST API

    yes we do. you want to pass the page size and page number. with sql statements paging is very easy to implement
    Michael Salzlechner
    StarZen Technologies, Inc
    http.://www.starzen.com

    Development Blog
    http://www.salzlechner.com/dev

    DataFlex Package Manager (aka Nuget for DataFlex)
    http://windowsdeveloper.com/dfPackage

  4. #4
    Join Date
    Feb 2009
    Location
    Perth, Western Australia
    Posts
    1,430

    Default Re: Pagination in the REST API

    Hi Mike,

    Quote Originally Posted by Mike Peat View Post
    I actually built a way to do something like this into my RESTLibrary, but without checking quite a bit I can't remember the exact mechanism...
    If I had turned the page (page 6) I would have found exactly what you described.

    Thanks.
    Kind regards,

    Clive Richmond
    Triumph Business Systems Pty Ltd
    www.triumph.com.au

  5. #5
    Join Date
    Feb 2009
    Location
    Perth, Western Australia
    Posts
    1,430

    Default Re: Pagination in the REST API

    Hi Michael,

    Quote Originally Posted by starzen View Post
    yes we do. you want to pass the page size and page number. with sql statements paging is very easy to implement
    Thanks for the tip. Is there any SQL code you are able to share?
    Kind regards,

    Clive Richmond
    Triumph Business Systems Pty Ltd
    www.triumph.com.au

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •