De Lijn (Independent Publisher) (#2104)

* First Version - De Lijn

* Create readme.md

* ApiProperties Added

* added images

* Update readme.md

* Update readme.md

* Update De-Lijn-Zoek.swagger.json

had a small bug with required props in return values when using it on terms that didn't return any

* Updated readme to reflect requests changes

* Changed file to reflect changes requested

* First changes made

* Update De-Lijn-Zoek.swagger.json

* Updated readme to reflect changes json

* added images of actions used in the flow

* updated remarks

* Update De-Lijn-Zoek.swagger.json
This commit is contained in:
Lschockaert 2022-11-11 17:09:05 +01:00 коммит произвёл GitHub
Родитель 7280bf43b1
Коммит 7e215a9337
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 606 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,533 @@
{
"swagger": "2.0",
"info": {
"title": "De Lijn",
"description": "Get locations of public bus stations and extra info from the Flemish bus company 'De Lijn'",
"version": "1.0",
"contact": {
"name": "Lenard Schockaert",
"url": "https://data.delijn.be",
"email": "lenard.schockaert@gmail.com"
}
},
"x-ms-connector-metadata": [
{
"propertyName": "Website",
"propertyValue": "https://data.delijn.be"
},
{
"propertyName": "Privacy policy",
"propertyValue": "https://www.delijn.be/en/content/privacy"
},
{
"propertyName": "Categories",
"propertyValue": "Data"
}
],
"host": "api.delijn.be",
"basePath": "/DLZoekOpenData/v1",
"schemes": [
"https"
],
"consumes": [],
"produces": [],
"paths": {
"/zoek/haltes/{searchTerm}": {
"get": {
"summary": "Search stops",
"description": "Search stops by description. Eg Veemarkt or station.",
"operationId": "SearchStops",
"produces": [
"application/json"
],
"parameters": [
{
"in": "path",
"name": "searchTerm",
"description": "the search term",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "huidigePositie",
"description": "Latidue and longitude coordinates seperated by a comma ex, 51.056064,3.797336 for the locations where stops are searched",
"type": "string"
},
{
"in": "query",
"name": "startIndex",
"description": "Format - int32. starting position for the list of found stops",
"type": "integer",
"default": 0
},
{
"in": "query",
"name": "maxAantalHits",
"description": "Format - int32. max amount of returned values by this service",
"type": "integer",
"default": 10
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"$ref": "#/definitions/HaltesHits"
},
"examples": {
"application/json": {
"aantalHits": 320,
"haltes": [
{
"entiteitnummer": "3",
"haltenummer": "303980",
"omschrijving": "Gilsonplein",
"gemeentenummer": 57,
"omschrijvingGemeente": "Leuven",
"geoCoordinaat": "50.98145261213046,4.823559183763914",
"links": [
{
"rel": "string",
"url": "string"
}
]
}
]
}
}
},
"500": {
"description": "service of achterliggende systemen niet beschikbaar"
}
}
}
},
"/zoek/lijnrichtingen/{searchTerm}": {
"get": {
"summary": "Search lines",
"description": "Search lines by number or description. Eg search line 48 or Hamont",
"operationId": "SearchLines",
"produces": [
"application/json"
],
"parameters": [
{
"in": "path",
"name": "searchTerm",
"description": "the search term",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "huidigePositie",
"description": "Latidue and longitude coordinates seperated by a comma ex, 51.056064,3.797336 for the locations where stops are searched",
"type": "string"
},
{
"in": "query",
"name": "startIndex",
"description": "Format - int32. starting position for the list of found lines",
"type": "integer",
"default": 0
},
{
"in": "query",
"name": "maxAantalHits",
"description": "Format - int32. max amount of returned values by this service",
"type": "integer",
"default": 10
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"$ref": "#/definitions/LijnRichtingHits"
},
"examples": {
"application/json": {
"aantalHits": 6,
"lijnrichtingen": [
{
"lijnNummerPubliek": "335",
"entiteitnummer": "3",
"lijnnummer": "335",
"richting": "HEEN",
"omschrijving": "Leuven - Aarschot",
"bestemming": "LEUVEN GASTHUISB.",
"kleurVoorGrond": "#FFFFFF",
"kleurAchterGrond": "#991199",
"kleurAchterGrondRand": "#991199",
"links": [
{
"rel": "string",
"url": "string"
}
]
}
]
}
}
},
"500": {
"description": "service of achterliggende systemen niet beschikbaar"
}
}
}
},
"/zoek/locaties/{searchTerm}": {
"get": {
"summary": "Search locations",
"description": "Search locations (x,y) by user address input. Typical for input on a routeplanner (eg kerkstraat 14 Hasselt or Achter De Kazerne ). Limited Geocoding service that returns stops, addresses or POIs and its XY coordinates",
"operationId": "SearchLocations",
"produces": [
"application/json;charset=UTF-8"
],
"parameters": [
{
"in": "path",
"name": "searchTerm",
"description": "the search term",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "huidigePositie",
"description": "Currently not supported for this operation",
"type": "string"
},
{
"in": "query",
"name": "startIndex",
"description": "Format - int32. starting position for the list of found lines",
"type": "integer",
"default": 0
},
{
"in": "query",
"name": "maxAantalHits",
"description": "Format - int32. max amount of returned values by this service",
"type": "integer",
"default": 10
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"$ref": "#/definitions/LocatiesHits"
},
"examples": {
"application/json;charset=UTF-8": {
"aantalHits": 51,
"locaties": [
{
"type": "address",
"subtype": "hoofdgemeente",
"deelgemeentes": "Putkapel,Leuven",
"hoofdgemeente": "Leuven",
"straat": "Bondgenotenlaan",
"haltenummer": "303205",
"huisnummer": "112",
"geoCoordinaat": "50.98145261213046,4.823559183763914"
}
]
}
}
},
"500": {
"description": "service of achterliggende systemen niet beschikbaar"
}
}
}
}
},
"definitions": {
"GeoCoordinaat": {
"type": "object",
"properties": {
"latitude": {
"format": "double",
"description": "contains the latitude of a location",
"type": "number"
},
"longitude": {
"format": "double",
"description": "contains the longitude of a location",
"type": "number"
}
}
},
"Halte": {
"required": [
"entiteitnummer",
"haltenummer",
"omschrijving"
],
"type": "object",
"properties": {
"entiteitnummer": {
"description": "number entity (key value)",
"type": "string",
"example": "3"
},
"haltenummer": {
"description": "stop number (key value)",
"type": "string",
"example": "303980"
},
"omschrijving": {
"description": "description of the stop",
"type": "string",
"example": "Gilsonplein"
},
"gemeentenummer": {
"format": "int32",
"description": "city number (key value)",
"type": "integer",
"example": 57
},
"omschrijvingGemeente": {
"description": "name of the city where the stop is located",
"type": "string",
"example": "Leuven"
},
"geoCoordinaat": {
"$ref": "#/definitions/GeoCoordinaat"
},
"links": {
"type": "array",
"items": {
"$ref": "#/definitions/Link"
}
}
}
},
"HaltesHits": {
"required": [
"aantalHits",
"haltes"
],
"type": "object",
"properties": {
"aantalHits": {
"format": "int32",
"description": "the amount of stops that match the search term",
"type": "integer",
"example": 320
},
"haltes": {
"description": "the stops that match the search term",
"type": "array",
"items": {
"$ref": "#/definitions/Halte"
}
}
}
},
"LijnRichtingHits": {
"required": [
"aantalHits",
"lijnrichtingen"
],
"type": "object",
"properties": {
"aantalHits": {
"format": "int32",
"description": "the amount of lines that match the search term",
"type": "integer",
"example": 6
},
"lijnrichtingen": {
"description": "the lines that match the search term",
"type": "array",
"items": {
"$ref": "#/definitions/Lijnrichting"
}
}
}
},
"Lijnrichting": {
"required": [
"entiteitnummer",
"lijnnummer",
"omschrijving",
"richting"
],
"type": "object",
"properties": {
"lijnNummerPubliek": {
"description": "public linenumber",
"type": "string",
"example": "335"
},
"entiteitnummer": {
"description": "number entity",
"type": "string",
"example": "3"
},
"lijnnummer": {
"description": "number line",
"type": "string",
"example": "335"
},
"richting": {
"description": "direction of the line",
"enum": [
"HEEN",
"TERUG"
],
"type": "string",
"example": "HEEN"
},
"omschrijving": {
"description": "description of the line",
"type": "string",
"example": "Leuven - Aarschot"
},
"bestemming": {
"description": "final stop of the line",
"type": "string",
"example": "LEUVEN GASTHUISB."
},
"kleurVoorGrond": {
"description": "color of the line on the vignet",
"type": "string",
"example": "#FFFFFF"
},
"kleurAchterGrond": {
"description": "background color of the line on the vignet",
"type": "string",
"example": "#991199"
},
"kleurAchterGrondRand": {
"description": "border color of the line on the vignet",
"type": "string",
"example": "#991199"
},
"links": {
"type": "array",
"items": {
"$ref": "#/definitions/Link"
}
}
}
},
"Link": {
"type": "object",
"properties": {
"rel": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"Locatie": {
"required": [
"subtype",
"type"
],
"type": "object",
"properties": {
"type": {
"description": "returns the type of location",
"enum": [
"adres",
"halte",
"herkenningspunt",
"station"
],
"type": "string",
"example": "adres"
},
"subtype": {
"description": "returns the subtype of location",
"enum": [
"hoofdgemeente",
"deelgemeente",
"straat",
"adres",
"halte",
"herkenningspunt",
"station"
],
"type": "string",
"example": "hoofdgemeente"
},
"deelgemeentes": {
"description": "returns a list of municipal districts names for this location",
"type": "array",
"items": {
"type": "string"
},
"example": "Putkapel,Leuven"
},
"hoofdgemeente": {
"description": "returns the main municipality name for this location",
"type": "string",
"example": "Leuven"
},
"straat": {
"description": "returns the street for this location",
"type": "string",
"example": "Bondgenotenlaan"
},
"haltenummer": {
"description": "returns the stopnumber for this location",
"type": "string",
"example": "303205"
},
"huisnummer": {
"description": "returns the housenumber for this location",
"type": "string",
"example": "112"
},
"geoCoordinaat": {
"$ref": "#/definitions/GeoCoordinaat"
}
}
},
"LocatiesHits": {
"required": [
"aantalHits",
"locaties"
],
"type": "object",
"properties": {
"aantalHits": {
"format": "int32",
"description": "the amount of locations that match the search term",
"type": "integer",
"example": 51
},
"locaties": {
"description": "the locations that match the search term",
"type": "array",
"items": {
"$ref": "#/definitions/Locatie"
}
}
}
}
},
"parameters": {},
"responses": {},
"securityDefinitions": {
"API Key": {
"type": "apiKey",
"in": "header",
"name": "Ocp-Apim-Subscription-Key"
}
},
"security": [
{
"API Key": []
}
],
"tags": []
}

Просмотреть файл

@ -0,0 +1,24 @@
{
"properties": {
"capabilities": [],
"connectionParameters": {
"api_key": {
"type": "securestring",
"uiDefinition": {
"constraints": {
"clearText": false,
"required": "true",
"tabIndex": 2
},
"description": "The api key from DeLijn",
"displayName": "Api key",
"tooltip": "Provide your KEY"
}
}
},
"iconBrandColor": "#da3b01",
"capabilities": [],
"publisher": "Lenard Schockaert",
"stackOwner": "De Lijn"
}
}

Просмотреть файл

@ -0,0 +1,49 @@
# De Lijn
'De Lijn' is the public transport company for busses in Flanders. This is a part of Belgium.
This service allows you to find a stop/line based on specific terms or location (lat/longitude)
The api that is used is published by 'De Lijn' - I am not the owner of this endpoint and a Power Automate enthusiast.
Submission containing materials of a third party: 'De lijn' - https://data.delijn.be/
'This portal is the gateway to the open data sets and webservices of De Lijn. Open Data De Lijn combines freely accessible and usable data on routes, stops, interruptions and timetables.'
More info on the webpage linked.
## Publisher: Lenard Schockaert
## Prerequisites
Create an account on https://data.delijn.be/
## Supported Operations
### Operation 1 - Search stops
Search stops by description. Eg Veemarkt or station.
![image](https://user-images.githubusercontent.com/8872614/199250884-83367551-7158-47b7-9df0-3311f73e80b3.png)
### Operation 2 - Search lines
Search lines by number or description. Eg search line 48 or Hamont
![image](https://user-images.githubusercontent.com/8872614/199250920-b0afe0a6-f4c2-42e8-9bf7-8724c5c78e5f.png)
### Operation 3 - SearchLocations
Search locations (x,y) by user adress input. Typical for input on a routeplanner (eg kerkstraat 14 Hasselt or Achter De Kazerne ) . Limitied Geocoding service that retuns stops, adresses or POIs and its XY coordinates
![image](https://user-images.githubusercontent.com/8872614/199250985-4d5fec7e-290c-4c5d-b4e6-9d0880f7022c.png)
## Obtaining Credentials
On the website mentioned at prerequisities, obtain an api key by going to your account and subscribe to the 'Open Data Free' to receive an api key.
## Getting Started
Get the api key
Import the connnector
Create connection
Get the closest bus stops in Power Platform
## Known Issues and Limitations
None, atm. Using the defintion delivered by 'De Lijn' company
## Flow Example
![image](https://user-images.githubusercontent.com/8872614/199251422-d9c8e533-3e07-4534-ad2b-238f08a88fcd.png)
![image](https://user-images.githubusercontent.com/8872614/199251449-aa06a034-a01e-412e-afa7-53fd5179b740.png)
![image](https://user-images.githubusercontent.com/8872614/199251471-4d31d356-d0b7-4b34-ac6c-026c18cfe532.png)