Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Idea: Add travelynx webhook integration #17

Open
PKuebler opened this issue Aug 8, 2020 · 1 comment · May be fixed by #24
Open

Idea: Add travelynx webhook integration #17

PKuebler opened this issue Aug 8, 2020 · 1 comment · May be fixed by #24
Assignees
Labels
enhancement New feature or request

Comments

@PKuebler
Copy link
Owner

PKuebler commented Aug 8, 2020

Automatically create new alarms when person checks in at travelynx. Delete alarm when person checks out.

Command to generate an own Webhook + JWT token which can be stored at Travelynx.

@PKuebler PKuebler added the enhancement New feature or request label Aug 8, 2020
@PKuebler
Copy link
Owner Author

Webhook Events

  • train line is empty if train name are type + no
  • checkedIn show the current state
  • toStation parameters are null, if no final station selected. not toStation!
  • intermediateStops parameters are null... :/ but not needed. :)

Ping on webhook changes

{
    "reason": "ping",
    "status": {
        "actionTime": 1598727069,
        "checkedIn": false,
        "deprecated": false,
        "fromStation": {
            "ds100": "AA",
            "latitude": 53.552695,
            "longitude": 9.935175,
            "name": "Hamburg-Altona",
            "realTime": 1598719920,
            "scheduledTime": 1598719860,
            "uic": 8002553
        },
        "intermediateStops": [],
        "toStation": {
            "ds100": "AF",
            "latitude": 54.774039,
            "longitude": 9.436526,
            "name": "Flensburg",
            "realTime": 1598726400,
            "scheduledTime": 1598726400,
            "uic": 8000103
        },
        "train": {
            "id": "7321508266973250399",
            "line": "7",
            "no": "28564",
            "type": "RE"
        }
    }
}

checkin

{
    "reason": "checkin",
    "status": {
        "actionTime": 1602355492,
        "checkedIn": true,
        "deprecated": false,
        "fromStation": {
            "ds100": "AH",
            "latitude": 53.552736,
            "longitude": 10.006909,
            "name": "Hamburg Hbf",
            "realTime": 1602356520,
            "scheduledTime": 1602356520,
            "uic": 8002549
        },
        "intermediateStops": [
            {
                "name": "Hamburg Dammtor",
                "realArrival": null,
                "realDeparture": null,
                "scheduledArrival": null,
                "scheduledDeparture": null
            },
            {
                "name": "Hamburg-Altona",
                "realArrival": null,
                "realDeparture": null,
                "scheduledArrival": null,
                "scheduledDeparture": null
            }
        ],
        "toStation": {
            "ds100": null,
            "latitude": null,
            "longitude": null,
            "name": null,
            "realTime": 0,
            "scheduledTime": 0,
            "uic": null
        },
        "train": {
            "id": "6884195623875740325",
            "line": null,
            "no": "1084",
            "type": "ICE"
        }
    }
}

undo checkin/checkout

{
    "reason": "undo",
    "status": {
        "actionTime": 1598727069,
        "checkedIn": false,
        "deprecated": false,
        "fromStation": {
            "ds100": "AA",
            "latitude": 53.552695,
            "longitude": 9.935175,
            "name": "Hamburg-Altona",
            "realTime": 1598719920,
            "scheduledTime": 1598719860,
            "uic": 8002553
        },
        "intermediateStops": [],
        "toStation": {
            "ds100": "AF",
            "latitude": 54.774039,
            "longitude": 9.436526,
            "name": "Flensburg",
            "realTime": 1598726400,
            "scheduledTime": 1598726400,
            "uic": 8000103
        },
        "train": {
            "id": "7321508266973250399",
            "line": "7",
            "no": "28564",
            "type": "RE"
        }
    }
}

select target/to station

{
    "reason": "update",
    "status": {
        "actionTime": 1602355563,
        "checkedIn": true,
        "deprecated": false,
        "fromStation": {
            "ds100": "AH",
            "latitude": 53.552736,
            "longitude": 10.006909,
            "name": "Hamburg Hbf",
            "realTime": 1602356520,
            "scheduledTime": 1602356520,
            "uic": 8002549
        },
        "intermediateStops": [
            {
                "name": "Hamburg Dammtor",
                "realArrival": null,
                "realDeparture": null,
                "scheduledArrival": null,
                "scheduledDeparture": null
            }
        ],
        "toStation": {
            "ds100": "AA",
            "latitude": 53.552695,
            "longitude": 9.935175,
            "name": "Hamburg-Altona",
            "realTime": 1602357240,
            "scheduledTime": 1602357240,
            "uic": 8002553
        },
        "train": {
            "id": "6884195623875740325",
            "line": null,
            "no": "1084",
            "type": "ICE"
        }
    }
}

checkout

{
    "reason": "checkout",
    "status": {
        "actionTime": 1602356671,
        "checkedIn": false,
        "deprecated": false,
        "fromStation": {
            "ds100": "AH",
            "latitude": 53.552736,
            "longitude": 10.006909,
            "name": "Hamburg Hbf",
            "realTime": 1602356520,
            "scheduledTime": 1602356520,
            "uic": 8002549
        },
        "intermediateStops": [],
        "toStation": {
            "ds100": "ADF",
            "latitude": 53.560751,
            "longitude": 9.989566,
            "name": "Hamburg Dammtor",
            "realTime": 1602356640,
            "scheduledTime": 1602356700,
            "uic": 8002548
        },
        "train": {
            "id": "6884195623875740325",
            "line": null,
            "no": "1084",
            "type": "ICE"
        }
    }
}

@PKuebler PKuebler self-assigned this Oct 10, 2020
@PKuebler PKuebler linked a pull request Oct 11, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant