Page 1 of 1

Download the schedules for stationIDs

PostPosted: Sat Feb 24, 2018 11:54 am
by toast
I'm trying to Download the schedules for stationIDs as per: https://github.com/SchedulesDirect/JSON-Service/wiki/API-20141201#download-the-schedules-for-stationids

So my code (python) looks like:

Code: Select all
headers={'token': token}
bd = ["83285"]
print('Sending: ', bd, '\n')
url = 'https://json.schedulesdirect.org/20141201/schedules'
response = requests.post(url, headers=headers, data=str(bd))
print(response)
print(response.text)


But the response i am getting back is:
Code: Select all
<Response [400]>
{"response":"REQUIRED_REQUEST_MISSING","code":2002,"serverID":"20141201.web.3","message":"Did not receive request.","datetime":"2018-02-24T17:06:28Z"}


Now, I have tried forming the body (bd) of the post in various ways, but no dice - can someone please advise how I should be doing this?

many thanks