Till senaste kommentaren
Detta inlägg är gammalt och kan innehålla inaktuell information.

How can I apply pagination on result

I am using this API https://api.sl.se/api2/TravelplannerV3_1/trip.<FORMAT>?key=<DIN API KEY> & parameters

I want to ask that how can I apply pagination? for example-> first hit of above url I want 1 to 5 results then on second hit I want 6 to 10 results then on third hit I want results from 11 to 15 and so on ...
how can I Achieve this? 
Thank you.

Kommentarer

  • Hej Shiv!

    You can send a context paramter for this. This is the parameter that specifies the starting point for searching later or earlier trips. The value for the context parameter is obtained by getting the result value srcF or SrcB in a call to the trip-service.
    By using the SrcF value, the next trips will be loaded. By using the SrcB parameter, the previous trips will be loaded.

    When using the context parameter, you should not send a date or time parameter.

    Regards,
    Bert


    Team Trafiklab

Kommentera eller skriv ett nytt inlägg

Ditt namn och inlägg kan ses av alla. Din e-post visas aldrig publikt.