Page 1 of 1

Headends + Lineups Requests Problems

Posted: Tue Mar 12, 2013 12:41 am
by icecreamman

Newbie checking in here....a little introduction: I just became a member of SchedulesDirect a week ago. I am looking to fill some of my free time working on an Android app that uses this API to display lineup information (or perhaps more appropriately "schedules"), ala a TV guide. Basically, my TV comes OTA through an antenna and I want to be able to know what shows are on at a given time.

I just started hacking away at the new JSON API and I have run into a few roadblocks (with my HTTP request knowledge and knowledge of this API, heh).

1. I am unable to retrieve the headends that are tied to my account. I retrieve the randhash on the first call and then whenever I send the headends request, I get back an unrelated set of headends.

Code: Select all

Request : {"action":"get","api":20130224,"randhash":"bf4de59ff7e7c0996cd5b529d3c3458a","object":"headends"}
Response: {"response":"OK","code":200,"serverID":"AWS-web.1","datetime":"2013-03-12T07:26:00Z","data":[{"headend":"0005986","name":"Shaw Direct","location":"Canada (East) Advanced"},{"headend":"0005995","name":"Shaw Direct","location":"Canada (East) Classic"},{"headend":"0009995","name":"Shaw Direct","location":"Canada (West) Advanced"},{"headend":"0009999","name":"Shaw Direct","location":"Canada (West) Classic"},{"headend":"0005993","name":"Bell TV","location":"Canada (East)"},{"headend":"0008999","name":"Bell TV","location":"Canada (West)"},{"headend":"FTA","name":"Free-to-air satellite","location":"Global"}]}
I currently have two headends configured to my account:

48103 Ann Arbor, US Comcast - Digital CableDigital
94117 San Francisco, US Local Broadcast Listings - Antenna LocalBroadcast

2. A separate problem I am having is that when I perform the lineups request for a given headend, the contents from the zip from the link in the "URL" field of this JSON response is empty. I have tried with
multiple headends with the same result. Each time the zip contains two text files, "Array.json.txt" and "serverID.txt". Array.json.txt is entirely empty. This is where the lineups should be in JSON, right?

Code: Select all

Request: {"action":"get","api":20130224,"object":"programs","request":{"request":["PC:94117"]},"randhash":"bf4de59ff7e7c0996cd5b529d3c3458a"}
Response: {"response":"OK","code":200,"serverID":"AWS-web.1","message":"file available at URL.","filename":"","URL":"https:\/\/\/schedulesdirect\/programs\/","datetime":"2013-03-12T07:26:02Z"}
I'm creating proper requests to the best of my knowledge, but can't seem to get any lineup data back. Can anybody help diagnose my problem? I can provide any more information if need be.

I have been reviewing the perl script from the main github page, the JSONTV python grabber, and the sdjson Java grabber that interact with this API for pointers (which I think coincides with the three guys that have been posting in this forum lately...). Anyway, thanks for all of help so far. Once I get something basic up and running, I will be sure to put the project up on github.


Re: Headends + Lineups Requests Problems

Posted: Tue Mar 12, 2013 7:25 am
by rkulagow
It doesn't appear that you've actually performed the "add" command using the API. The existing Schedules Direct website lineups are for the XML service, not the JSON service.

Please see the wiki for the "add" "headends" command. Once you do that, the rest should go better.

I will update the response to indicate that a headend needs to be configured first.

Re: Headends + Lineups Requests Problems

Posted: Tue Mar 12, 2013 7:31 am
by rkulagow
Also, in the "get" "headends" request, you need to provide the postal code that you'd like to get headends for. You didn't send anything, so you basically got the "national" headends for Canada.

If you look at the Wiki, you'll see the typical flow that your client will need to perform to get initially configured, and then what it needs to do in "steady state".

Re: Headends + Lineups Requests Problems

Posted: Tue Mar 12, 2013 8:02 am
by rkulagow
The beta server has been updated to send an error if a request is made for headends without having any configured in the account.

Re: Headends + Lineups Requests Problems

Posted: Tue Mar 12, 2013 10:33 am
by icecreamman
D'oh! Now that I re-read the wiki, I see that it is mentioned there, too. I made some assumptions about the headends per account. Thanks for the quick answer!

Also, I am all for more errors returned in the case of "illegal" requests, or whatever you want to call it. It definitely helps out people that are unfamiliar with the API. :)

Re: Headends + Lineups Requests Problems

Posted: Tue Mar 12, 2013 10:36 am
by rkulagow
That's what you guys are for - to find all my assumptions and invalidate them. :)