Welcome to OASA Telematics API’s documentation!

The api has the following form ::

http://telematics.oasa.gr/api/?act=action&p1=parameter1&p2=parameter2

Μέσα από το script (Script v0.1.1) το οποίο χρησιμοποιούν στο http://telematics.oasa.gr/ τα requests που έχω τεκμηριώσει ως τώρα είναι POST requests τα οποία περνάνε τις παραμέτρους στο url .

Code example: Python

Χρήση του API μέσω python requests. Το μόνο που αλλάζει είναι το endpoint.

>>> import requests
>>> response = requests.post("http://telematics.oasa.gr/api/?act=getLinesAndRoutesForMl&p1=9")
>>> json_response = response.json()
>>> print(json_response[0]["line_descr"])
'ΠΛΑΤΕΙΑ ΚΑΝΙΓΓΟΣ - ΓΚΥΖH'

Code example: BASH

Το ίδιο request με BASH. Πρέπει να είναι εγκατεστημένα το curl και το jq.

$ curl -s "telematics.oasa.gr/api/?act=getLinesAndRoutesForMl&p1=9" | jq '.[].line_descr'
"ΠΛΑΤΕΙΑ ΚΑΝΙΓΓΟΣ - ΓΚΥΖH(ΚΥΚΛΙΚΗ)"

Code example: PowerShell

Και με powershell με χρήση της Invoke-RestMethod.

PS C:\> (Invoke-RestMethod "http://telematics.oasa.gr/api/?act=getLinesAndRoutesForMl&p1=9").line_descr
ΠΛΑΤΕΙΑ ΚΑΝΙΓΓΟΣ - ΓΚΥΖH(ΚΥΚΛΙΚΗ)

Not Implemented yet