{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Authentication","type":"basic","slug":"authentication-1","excerpt":"","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.","updates":[],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"54a1580cce33cf1600c2334d","__v":1,"createdAt":"2014-12-29T13:33:00.263Z","project":"54995cb59da9390b00cffac6","category":{"sync":{"isSync":false,"url":""},"pages":["54995cb69da9390b00cffacc","54995f2c9da9390b00cffad1","54995fc70195cc0b00dc32df","54a1580cce33cf1600c2334d"],"title":"Documentation","slug":"documentation","order":0,"from_sync":false,"reference":false,"_id":"54995cb59da9390b00cffaca","version":"54995cb59da9390b00cffac9","__v":4,"createdAt":"2014-12-23T12:14:45.902Z","project":"54995cb59da9390b00cffac6"},"githubsync":"","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["54995cb59da9390b00cffaca","54995e289da9390b00cffad0","5499610f0195cc0b00dc32e2"],"_id":"54995cb59da9390b00cffac9","releaseDate":"2014-12-23T12:14:45.422Z","__v":3,"createdAt":"2014-12-23T12:14:45.422Z","project":"54995cb59da9390b00cffac6"},"user":"54995c979da9390b00cffac5"}
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.