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

sl-realtidsinformation-4

Hi,

I am trying to upgrade the API from 3 to 4 i.e. sl-realtidsinformation-4,
but didn't understand where to get the values of siteid and what is time window?
Could you please provide a demo request with parameters.Thanks

Regards
Harsh

Kommentarer

  • Hello Harsh Srivastava,
    An example can be found in the console for SL Realtidsinformation 4

    http://api.sl.se/api2/realtimedeparturesv4.json?key=<KEY>&siteid=9192&timewindow=5

    In the above example the siteid 9192 is the stop Slussen and the timewindow parameter limits the results to departures within 5 minutes.

    Siteid can be found using this API
    An example of request: http://api.sl.se/api2/LineData.xml?model=site&key=

    Kind regards
    Kenneth
    Team Trafiklab
  • hi Kenneth,

    It means now in have to make an api call to get the SiteID?? Which is not required in the version 3 ??

    Regards
    HARSH
  • Hi Harsh,
    It depends on you application and needs. If your application is always checking the same site there is no need to use the hållplatser och linjer API 😀

    Kinds regards
    Kenneth
    Team Trafiklab
  • hi Kenneth,

    one last question, What's the use of site ID ?? 

    Thanks
  • Hi Harsh,
    It is a way of limiting the search results to a specific station.

    Best regards
    Kenneth
    Team Trafiklab
  • Hi,

    I am getting invalid api key, statusCode: 1005

    Link: http://api.sl.se/api2/realtimedeparturesv4.json?key=&siteid=9192&timewindow=5

    I have tried Key values of SL Traffic mode 2, SL Disturbance Information 2, SL Location Lookup .

    Please suggest.

    Thanks
  • Hi again Harsh,
    The above link you provided is missing a personal API key. You need to create a project and get valid keys for the API:s.

    Please follow the guide:
    https://www.trafiklab.se/hur-gor-jag

    There is a drop down in the top right corner where you can change the language to english.

    Best regards
    Kenneth
    Team Trafiklab
  • there are 3 type of API keys available and in have tried each but itsnot working, Types of API are given below: 

    1: SL Disturbance Information 2
    2: SL Traffic fashion 2
    3: SL Location Lookup

    Please find the attached screenshot.

    Please suggest which api key i need to use.

    Thanks

  • Hi,
    For the above API request you need a key for SL Real Time Information 4. Each key is unique and not interchangable between APIs. It seems like you need to apply for a new key for SL Real Time Information 4

    Best regards
    Kenneth
    Team Trafiklab

Kommentera eller skriv ett nytt inlägg

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