{"action":"created","issue":{"url":"https://api.github.com/repos/iRail/iRail/issues/383","repository_url":"https://api.github.com/repos/iRail/iRail","labels_url":"https://api.github.com/repos/iRail/iRail/issues/383/labels{/name}","comments_url":"https://api.github.com/repos/iRail/iRail/issues/383/comments","events_url":"https://api.github.com/repos/iRail/iRail/issues/383/events","html_url":"https://github.com/iRail/iRail/issues/383","id":505745452,"node_id":"MDU6SXNzdWU1MDU3NDU0NTI=","number":383,"title":"Add an API endpoint to retrieve the vehicle composition for a journey","user":{"login":"Bertware","id":1094793,"node_id":"MDQ6VXNlcjEwOTQ3OTM=","avatar_url":"https://avatars0.githubusercontent.com/u/1094793?v=4","gravatar_id":"","url":"https://api.github.com/users/Bertware","html_url":"https://github.com/Bertware","followers_url":"https://api.github.com/users/Bertware/followers","following_url":"https://api.github.com/users/Bertware/following{/other_user}","gists_url":"https://api.github.com/users/Bertware/gists{/gist_id}","starred_url":"https://api.github.com/users/Bertware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bertware/subscriptions","organizations_url":"https://api.github.com/users/Bertware/orgs","repos_url":"https://api.github.com/users/Bertware/repos","events_url":"https://api.github.com/users/Bertware/events{/privacy}","received_events_url":"https://api.github.com/users/Bertware/received_events","type":"User","site_admin":false},"labels":[{"id":251455715,"node_id":"MDU6TGFiZWwyNTE0NTU3MTU=","url":"https://api.github.com/repos/iRail/iRail/labels/New%20feature","name":"New feature","color":"6df230","default":false,"description":""}],"state":"open","locked":false,"assignee":{"login":"Bertware","id":1094793,"node_id":"MDQ6VXNlcjEwOTQ3OTM=","avatar_url":"https://avatars0.githubusercontent.com/u/1094793?v=4","gravatar_id":"","url":"https://api.github.com/users/Bertware","html_url":"https://github.com/Bertware","followers_url":"https://api.github.com/users/Bertware/followers","following_url":"https://api.github.com/users/Bertware/following{/other_user}","gists_url":"https://api.github.com/users/Bertware/gists{/gist_id}","starred_url":"https://api.github.com/users/Bertware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bertware/subscriptions","organizations_url":"https://api.github.com/users/Bertware/orgs","repos_url":"https://api.github.com/users/Bertware/repos","events_url":"https://api.github.com/users/Bertware/events{/privacy}","received_events_url":"https://api.github.com/users/Bertware/received_events","type":"User","site_admin":false},"assignees":[{"login":"Bertware","id":1094793,"node_id":"MDQ6VXNlcjEwOTQ3OTM=","avatar_url":"https://avatars0.githubusercontent.com/u/1094793?v=4","gravatar_id":"","url":"https://api.github.com/users/Bertware","html_url":"https://github.com/Bertware","followers_url":"https://api.github.com/users/Bertware/followers","following_url":"https://api.github.com/users/Bertware/following{/other_user}","gists_url":"https://api.github.com/users/Bertware/gists{/gist_id}","starred_url":"https://api.github.com/users/Bertware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bertware/subscriptions","organizations_url":"https://api.github.com/users/Bertware/orgs","repos_url":"https://api.github.com/users/Bertware/repos","events_url":"https://api.github.com/users/Bertware/events{/privacy}","received_events_url":"https://api.github.com/users/Bertware/received_events","type":"User","site_admin":false}],"milestone":null,"comments":14,"created_at":"2019-10-11T09:34:49Z","updated_at":"2019-12-30T12:26:15Z","closed_at":null,"author_association":"MEMBER","body":"The NMBS added vehicle formations to their train map:\r\nhttps://twitter.com/SIMPYbe/status/1181918580813762561\r\n\r\n![Train composition by NMBS](https://user-images.githubusercontent.com/1094793/66641466-1ad5c480-ec1b-11e9-8f1a-ea3237b86108.png)\r\n\r\nIt would be interesting to add an endpoint to the iRail API, which allows 3rd party apps to retrieve the details for a train, based on the journey. An example could be `/traincomposition?id=IC537&format=json` . \r\n\r\nSource data comes from `https://trainmapjs.azureedge.net/data/composition/<trainNumber>`:\r\n\r\n```\r\n[\r\n  {\r\n    \"ptCarFrom\": {\r\n      \"id\": 1088,\r\n      \"uicCode\": \"8893401\",\r\n      \"fromName\": \"St-Nicolas - Sint-Niklaas\"\r\n    },\r\n    \"ptCarTo\": {\r\n      \"id\": 319,\r\n      \"uicCode\": \"8893401\",\r\n      \"fromName\": \"Termonde - Dendermonde\"\r\n    },\r\n    \"confirmedBy\": \"Atlas\",\r\n    \"materialUnits\": [\r\n      {\r\n        \"hasReadingLights\": true,\r\n        \"hasFoldingSeats\": true,\r\n        \"hasAssistanceButtons\": true,\r\n        \"hasToilets\": true,\r\n        \"hasTables\": true,\r\n        \"hasSecondClassOutlets\": true,\r\n        \"hasFirstClassOutlets\": true,\r\n        \"hasHeating\": true,\r\n        \"hasAirco\": true,\r\n        \"typeDescriptionNl\": \"HV M6 BUH\",\r\n        \"tractionType\": \"HV\",\r\n        \"pullPushType\": \"R\",\r\n        \"diagramServiceNumber\": 57,\r\n        \"materialNumber\": 62263,\r\n        \"materialDiagram\": \"KR\",\r\n        \"uicCode\": \"508826922637\",\r\n        \"isLocoInUse\": false,\r\n        \"inDirection\": true,\r\n        \"tractionPosition\": 2,\r\n        \"positionInComposition\": 1,\r\n        \"materialSubTypeName\": \"M6BUH\",\r\n        \"typeDescriptionFr\": \"HV M6 BUH\",\r\n        \"hasPriorityPlaces\": true,\r\n        \"brutoWeight\": 64,\r\n        \"lengthInMeter\": 27,\r\n        \"hasPrmSection\": false,\r\n        \"standingPlacesSecondClass\": 133,\r\n        \"standingPlacesFirstClass\": 0,\r\n        \"seatsCoupeSecondClass\": 0,\r\n        \"seatsCoupeFirstClass\": 0,\r\n        \"seatsSecondClass\": 140,\r\n        \"seatsFirstClass\": 0,\r\n        \"isDrivingCabinetAvailable\": false,\r\n        \"hasServiceSection\": false,\r\n        \"withTowBar\": false,\r\n        \"withTractionCoupling\": false,\r\n        \"hasBikeSection\": false,\r\n        \"isEquipedForMux\": true,\r\n        \"isSecondClass\": true,\r\n        \"isFirstClass\": false,\r\n        \"materialSubTypeSuffix\": \"BUH\",\r\n        \"withAutomaticCoupling\": false,\r\n        \"subTypeDescriptionFr\": \"HV M6 BUH\",\r\n        \"subTypeDescriptionNl\": \"HV M6 BUH\",\r\n        \"canPassToNextUnit\": true,\r\n        \"hasCameras\": false,\r\n        \"hasRealTimeInformationScreens\": false,\r\n        \"hasWasteBins\": true,\r\n        \"hasSemiAutomaticInteriorDoors\": true,\r\n        \"hasLuggageSection\": false\r\n      },\r\n    ...\r\n    ]\r\n  }\r\n]\r\n```"},"comment":{"url":"https://api.github.com/repos/iRail/iRail/issues/comments/569665141","html_url":"https://github.com/iRail/iRail/issues/383#issuecomment-569665141","issue_url":"https://api.github.com/repos/iRail/iRail/issues/383","id":569665141,"node_id":"MDEyOklzc3VlQ29tbWVudDU2OTY2NTE0MQ==","user":{"login":"ChristopheVersieux","id":356214,"node_id":"MDQ6VXNlcjM1NjIxNA==","avatar_url":"https://avatars0.githubusercontent.com/u/356214?v=4","gravatar_id":"","url":"https://api.github.com/users/ChristopheVersieux","html_url":"https://github.com/ChristopheVersieux","followers_url":"https://api.github.com/users/ChristopheVersieux/followers","following_url":"https://api.github.com/users/ChristopheVersieux/following{/other_user}","gists_url":"https://api.github.com/users/ChristopheVersieux/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristopheVersieux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristopheVersieux/subscriptions","organizations_url":"https://api.github.com/users/ChristopheVersieux/orgs","repos_url":"https://api.github.com/users/ChristopheVersieux/repos","events_url":"https://api.github.com/users/ChristopheVersieux/events{/privacy}","received_events_url":"https://api.github.com/users/ChristopheVersieux/received_events","type":"User","site_admin":false},"created_at":"2019-12-30T12:26:15Z","updated_at":"2019-12-30T12:26:15Z","author_association":"MEMBER","body":"First remarks after a quick play with the API, tested with: https://staging.api.irail.be/composition.php?id=L4662&format=json&data=all\r\n\r\n1) In the JSON structure, I see composition twice: (**composition**/segments/segment[]/**composition**/units). Not really an issue, but will cause issues using some parsers. \r\n\r\n2) For the 2 segments, origin and destinations are the same (mons for segment 1 and Tournai for Segment 2) while https://trainmapjs.azureedge.net/data/composition/4662 has a Quevy/Mons and Tounai/Mons)\r\n\r\nMaybe I missed something in previous comments regarding these remarks?"}}
{"actor":{"display_login":"ChristopheVersieux"}}