Skip to content

4. Service call

Arjan edited this page May 25, 2024 · 16 revisions

Service calls are available

1. Download gtfs static data, e.g. to automate frequent updates.

This will erase any files with the same name in gtfs2 folder, then download a new zip and extract

image

Removed feed_info: in case you have errors related to feed_info.txt in the zip, this allows you to remove this from the zip file before it gets extracted to the database.

2. Download gtfs realtime data, to reduce multiple downloads from the same source for different trips

Example: you have multiple routes setup from source xyx (e.g. Netherlands, Germany, Switzerland - wide), to avoid calling externally for each one of them and collect a large(r) set of data evry minute multiple times, you can choose to download via a single call and point your routes to the local file instead.

Note: this approach could apply to all realtime sources, TripUpdates, VehicleLocations, Alerts

image

The file will receive a .rt added to the name that was entered

Note: for debugging purposes (last option), it can create a converted, human-readable file in your www/gtfs2 folder. This can help identify if your provider includes the details for your route/trip. This file will receive a _converted.txt added to the name that was entered

Field content for autorization via api-key's:

  • API key : usually a long string
  • API key name: depends on the service provider, known key-names are:
    • Authorization , default value and covers key previsously labeled as 'api_key'
    • x_api_key
    • apiKey
    • ocp_apim_subscription_key

You are free to type in any 'key name' that applies to your provider requirements.

If your provider requires an authentication method with a (x_)api_key, you can apply this either in a 'header' or as part of the url 'query_string. Check with the provider which method applies

3. Update the local stops, especially when you have tied them to a location changing person.

Note: strongly recommended is to not apply an automation with high frequency as this is usually not required. Suggest to base it when person lat/lon is 'stable' for a while. You can also tie this service to a action (button)

image