API keys

I recently upgraded my keys from Bronze to silver but unfortunately it’s not working.
I probably need to update the Trafiklab keys in. This is what I am getting: 

RESROBOT_API_KEY (ResRobot v2.1 quota is exceeded)TRAFIKLAB_REALTIME_API_KEY and TRAFIKLAB_STATIC_API_KEY (both currently return "Key does not exist")
Need help with this so my app can function normally
Best regards 
Martin

Kommentarer

  • Hi Martin, 
    It sounds like you are using the wrong key for the wrong api/dataset. I see that you have 4 different keys so that means you should be using 4 different URLs. You have statistics on your three keys: 'GTFS Sweden 3 Realtime', 'GTFS Sweden 3 Static data' and 'Resrobot v2.1' which means they seem to work. 

    Which key exactly are you having problems with and which url are you using to that key? 

    Best regards
    Sofie
    Sofie på Trafiklab
  • Hi Sofie, Thank you for the quick responds
    Our edge function hits three Trafiklab URLs, each with a specific key:

    1. Static GTFS dataset (the one returning "Key does not have access to file")

    • URL: https://opendata.samtrafiken.se/gtfs/{operator}/{operator}.zip?key=…(e.g. …/dt/dt.zip for Din Tur, …/sl/sl.zip for SL)
    • Key used: GTFS Sweden 3 Static data (9ad...87c)
    2. Realtime departures (the one returning error.key.invalid)

    • URL: https://realtime-api.trafiklab.se/v1/stops/name/{name}?key=…
    • URL: https://realtime-api.trafiklab.se/v1/departures/{stopId}?key=…
    • Key used: GTFS Sweden 3 Realtime (90a...0bb)
    3. ResRobot fallback (this one works)

    • URL: https://api.resrobot.se/v2.1/location.nearbystopsand /departureBoard
    • Key used: ResRobot v2.1
    But Is https://opendata.samtrafiken.se/gtfs/{operator}/{operator}.zipthe correct endpoint for the "GTFS Sweden 3 Static data" key, or should I use a different host (e.g. opendata.samtrafiken.se/gtfs-sweden-3/…or the Mobility Database feed)? We're getting "Key does not have access to file".
    • Is https://realtime-api.trafiklab.se/v1/…the correct base URL for the "GTFS Sweden 3 Realtime" key? We're getting error.key.invalid even though the dashboard shows 298 requests on that key.
    The fourth key is not being used. I will remove that. 
    Best regards 

    Martin
    Martin
  • Hi again, 
    So yes you are using the wrong URLs for these keys. 

    1 - Static data)  You are trying to get our GTFS Regional dataset with a GTFS Sweden key. For your key to work you need to call: https://opendata.samtrafiken.se/gtfs-sweden/sweden.zip?key={apikey}

    2 - Realtime data) You are using the url that should have been called with your 4th key (the one you didnt use). In order to get GTFS Sweden 3 Realtime you need to use one of these three urls (or all) depending on what you are interested in. 

    All our APIs and datasets are listed in the side menu here: https://www.trafiklab.se/api/ , and by clicking on each one you will find all information relevant to that api. 

    Hope this will help you forward. 

    Best regards,
    Sofie

    Sofie på Trafiklab

Kommentera eller skriv ett nytt inlägg

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