DRAFT: Delta between API 20140530 and 20141201

rkulagow
SD Staff
Posts: 915
Joined: Tue Aug 14, 2007 3:15 pm

Re: DRAFT: Delta between API 20140530 and 20141201

Post by rkulagow » Sun Apr 26, 2015 10:46 am

Please see if

https://github.com/SchedulesDirect/JSON ... stationids

answers your questions now.

GameGod
Posts: 60
Joined: Fri Aug 17, 2007 12:26 pm

Re: DRAFT: Delta between API 20140530 and 20141201

Post by GameGod » Sun Apr 26, 2015 11:10 am

rkulagow wrote:Please see if

https://github.com/SchedulesDirect/JSON ... stationids

answers your questions now.
I think it would be better if the return were an array with the status element inside it. This would make the result returned by this call consistent (always an array of objects). Can this be changed?

Something like:

Code: Select all

[
	{
		"stationID": "17021",
		"response": "ERROR",
		"serverID": "20141201.1",
		"code": 2201,
		"message": "The stationID you requested has been marked as deleted and will be purged.",
		"datetime": "2014-11-09T13:18:52Z"
	}
]
Also, in the current implementation, what happens if more than one station id has an error?

It would be nice if the https://json.schedulesdirect.org/20141201/programs call also returned an error result the same way.

Thanks.

rkulagow
SD Staff
Posts: 915
Joined: Tue Aug 14, 2007 3:15 pm

Re: DRAFT: Delta between API 20140530 and 20141201

Post by rkulagow » Sun Apr 26, 2015 11:23 am

20141201 is done; there are enough live clients that I don't want to pull the rug out from under developers. It can be the first thing for 20150501.

GameGod
Posts: 60
Joined: Fri Aug 17, 2007 12:26 pm

Re: DRAFT: Delta between API 20140530 and 20141201

Post by GameGod » Sun Apr 26, 2015 5:20 pm

rkulagow wrote:20141201 is done; there are enough live clients that I don't want to pull the rug out from under developers. It can be the first thing for 20150501.
I was trying to test what would happen in case a station id was wrong, and I am currently getting a 500 error. Looks like this is broken.

I also found out that the /programs call already does what I wanted and returns an array with a mixture of status and program info elements to match the given list of valid and invalid program id's.

rkulagow
SD Staff
Posts: 915
Joined: Tue Aug 14, 2007 3:15 pm

Re: DRAFT: Delta between API 20140530 and 20141201

Post by rkulagow » Fri May 15, 2015 9:02 am

There is now support for fractional channels. DirecTV now has 209.1, 209.2, etc.

USA-DITV810-DEFAULT

<snip>
{
"stationId": "45507",
"callSign": "ESPN2HD",
"channel": "209",
"preferredImage": {
"width": "360",
"height": "270",
"uri": "h3/NowShowing/45507/s45507_h3_aa.png",
"category": "Logo",
"primary": "true"
}
}, {
"stationId": "19620",
"callSign": "ESPNA",
"channel": "209",
"preferredImage": {
"uri": "sources/generic/generic_sources_h3.png"
}
}, {
"stationId": "12444",
"callSign": "ESPN2",
"channel": "209",
"preferredImage": {
"width": "360",
"height": "270",
"uri": "h3/NowShowing/12444/s12444_h3_aa.png",
"category": "Logo",
"primary": "true"
}
}, {
"stationId": "19621",
"callSign": "ESPN2A",
"channel": "209",
"preferredImage": {
"uri": "sources/generic/generic_sources_h3.png"
}
}, {
"stationId": "19620",
"callSign": "ESPNA",
"channel": "209.1",
"preferredImage": {
"uri": "sources/generic/generic_sources_h3.png"
}
}, {
"stationId": "19621",
"callSign": "ESPN2A",
"channel": "209.2",
"preferredImage": {
"uri": "sources/generic/generic_sources_h3.png"
}
}

The multiple copies of 209 will be going away shortly.

rkulagow
SD Staff
Posts: 915
Joined: Tue Aug 14, 2007 3:15 pm

Re: DRAFT: Delta between API 20140530 and 20141201

Post by rkulagow » Tue Jun 16, 2015 8:17 am

Two new potential response codes when requesting a schedule:

Code 7010: This is a fatal server side error. If your code receives a 7010 error, do not retry the schedule request.
Code 7020: Your code has requested a schedule that is out of the range of dates for that stationID. The response will indicate your requested date, and what the actual min / max dates are on the server. Your client should not retry using the same date because the server doesn't have the data to send.

Here's an example of a code 7020 response:

Code: Select all

[{"stationID":"92371","code":7020,"message":"Date requested (2015-07-04) not within 2015-06-16 -> 2015-06-28 for stationID 92371."}]
The actual text response may change; the response format will be finalized by 2015-06-17.

GameGod
Posts: 60
Joined: Fri Aug 17, 2007 12:26 pm

Re: DRAFT: Delta between API 20140530 and 20141201

Post by GameGod » Wed Jun 17, 2015 9:37 am

rkulagow wrote:Two new potential response codes when requesting a schedule:

Code 7010: This is a fatal server side error. If your code receives a 7010 error, do not retry the schedule request.
Code 7020: Your code has requested a schedule that is out of the range of dates for that stationID. The response will indicate your requested date, and what the actual min / max dates are on the server. Your client should not retry using the same date because the server doesn't have the data to send.

Here's an example of a code 7020 response:

Code: Select all

[{"stationID":"92371","code":7020,"message":"Date requested (2015-07-04) not within 2015-06-16 -> 2015-06-28 for stationID 92371."}]
The actual text response may change; the response format will be finalized by 2015-06-17.
Can you please update the API documentation, when possible? Also, it would be nice to mention that the MD5 endpoint is the preferred way to get the valid date ranges for a particular station.
Would also prefer the min/max duplicated in separate fields for easier processing.

Thanks.

rkulagow
SD Staff
Posts: 915
Joined: Tue Aug 14, 2007 3:15 pm

Re: DRAFT: Delta between API 20140530 and 20141201

Post by rkulagow » Mon Jun 22, 2015 1:12 pm

GameGod wrote:
rkulagow wrote:Two new potential response codes when requesting a schedule:

Code 7010: This is a fatal server side error. If your code receives a 7010 error, do not retry the schedule request.
Code 7020: Your code has requested a schedule that is out of the range of dates for that stationID. The response will indicate your requested date, and what the actual min / max dates are on the server. Your client should not retry using the same date because the server doesn't have the data to send.

Here's an example of a code 7020 response:

Code: Select all

[{"stationID":"92371","code":7020,"message":"Date requested (2015-07-04) not within 2015-06-16 -> 2015-06-28 for stationID 92371."}]
The actual text response may change; the response format will be finalized by 2015-06-17.
Can you please update the API documentation, when possible? Also, it would be nice to mention that the MD5 endpoint is the preferred way to get the valid date ranges for a particular station.
Would also prefer the min/max duplicated in separate fields for easier processing.

Thanks.
The documentation at https://github.com/SchedulesDirect/JSON ... stationids has been updated to clarify things.

Post Reply