open connection

This block is part of the NS group and was last modified in core v15.0.0.

open connection v15.0.0

Open a connection with the NS (Nederlandse Spoorwegen) Reisinformatie API. Reuse the resulting connection in the other NS blocks.

In pins 2 + flow
  • flow
    flow
  • API key required
    value

    Your NS API subscription key (Ocp-Apim-Subscription-Key) from the NS API portal.

  • Base URL
    value

    Optional override for the API base URL. Defaults to the public NS gateway.

    Default https://gateway.apiportal.ns.nl/reisinformatie-api

Out pins 3 + flow
  • flow
    flow
  • Connection
    nsconnection

    The NS connection.

  • Success
    condition

    True if a valid connection could be created.

  • Error
    value

    Error message if the connection could not be established.

trein
spoor
ns api
reisinformatie

A typical wiring for open connection: get setting feeds the api_key pin; the flow out pin feeds branch; the connection out pin feeds get nearest stations.

Studio canvas example for the open connection block: typical wiring for open connection.

Commonly used with

In production blueprints, this block is most often wired together with:

  • branch: this block feeds into it.
  • get nearest stations: this block feeds into it. Find the NS stations closest to a coordinate. Provide a geo point, or a separate latitude and longitude.
  • get stations: this block feeds into it. List or search NS stations. Leave the search empty to retrieve all stations.
  • create: feeds into this block. Creates a new function that can be executed using the given name.
  • get setting: feeds into this block. get a created system setting.

Version history

Introduced in v15.0.0.


Back to NS Return to the main group to view all sub-groups Back to NS Return to the group to view all blocks within this group