{"_id":"54a1580cce33cf1600c2334d","__v":1,"project":"54995cb59da9390b00cffac6","category":{"_id":"54995cb59da9390b00cffaca","pages":["54995cb69da9390b00cffacc","54995f2c9da9390b00cffad1","54995fc70195cc0b00dc32df","54a1580cce33cf1600c2334d"],"version":"54995cb59da9390b00cffac9","__v":4,"project":"54995cb59da9390b00cffac6","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-12-23T12:14:45.902Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"githubsync":"","version":{"_id":"54995cb59da9390b00cffac9","__v":3,"project":"54995cb59da9390b00cffac6","createdAt":"2014-12-23T12:14:45.422Z","releaseDate":"2014-12-23T12:14:45.422Z","categories":["54995cb59da9390b00cffaca","54995e289da9390b00cffad0","5499610f0195cc0b00dc32e2"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"54995c979da9390b00cffac5","metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-12-29T13:33:00.263Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"In order to access API endpoints you can pass your API Token as an Authorization header with type `Token`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -H 'Authorization: Token YOUR_SERVER_TOKEN' \\\\\\n'https://tfe-opendata.com/api/v1/timetables/36235979'\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var xhr = new XMLHttpRequest();\\nxhr.open('GET', 'https://tfe-opendata.com/api/v1/timetables/36235979');\\nxhr.setRequestHeader(\\\"Authorization\\\", \\\"Token YOUR_SERVER_TOKEN\\\")\\nxhr.onload = function() {\\n    if (xhr.status === 200) {\\n        alert(xhr.responseText);\\n    }\\n    else {\\n        alert('Request failed.  Returned status of ' + xhr.status);\\n    }\\n};\\nxhr.send();\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nThe command above will retrieve the full, current seven-day timetable for the northbound stop at Elm Row.","excerpt":"","slug":"authentication-1","type":"basic","title":"Authentication"}
In order to access API endpoints you can pass your API Token as an Authorization header with type `Token`. [block:code] { "codes": [ { "code": "curl -H 'Authorization: Token YOUR_SERVER_TOKEN' \\\n'https://tfe-opendata.com/api/v1/timetables/36235979'", "language": "shell" } ] } [/block] [block:code] { "codes": [ { "code": "var xhr = new XMLHttpRequest();\nxhr.open('GET', 'https://tfe-opendata.com/api/v1/timetables/36235979');\nxhr.setRequestHeader(\"Authorization\", \"Token YOUR_SERVER_TOKEN\")\nxhr.onload = function() {\n if (xhr.status === 200) {\n alert(xhr.responseText);\n }\n else {\n alert('Request failed. Returned status of ' + xhr.status);\n }\n};\nxhr.send();", "language": "javascript" } ] } [/block] The command above will retrieve the full, current seven-day timetable for the northbound stop at Elm Row.