Page 1 of 1

404 error trying to retrieve programs...

Posted: Thu Mar 19, 2020 10:39 am
by gpnash
Been working my way thru the API20141201 documentation.
Got a token, got channel listings, got schedule information with MD5 markers and the got the real program schedules.
Now that I'm trying to get the program information itself I'm getting a 404 error no matter what I try.

Code: Select all

 Dim MyPost = New WebClient
            Dim MyResults = String.Empty
            With MyPost
                .Encoding = System.Text.Encoding.UTF8
                .Headers.Add("token", MyToken)
                .Headers.Add(HttpRequestHeader.UserAgent, "SDImport")
                .Headers.Add(HttpRequestHeader.ContentType, "application/json;charset=UTF-8")
                .Headers.Add(HttpRequestHeader.Accept, "application/json")
                .Headers.Add(HttpRequestHeader.Accept, "deflate,gzip")
                Try
                    MyResults = .UploadString("https://json.schedulesdirect.org/20141201/programs", request)
                Catch ex As Exception
                    MyResults = ex.Message + If(ex.InnerException Is Nothing, " ", vbCrLf + ex.InnerException.Message) + ControlChars.NewLine + request
                End Try
            End With
            MyPost.Dispose()
Here's what the request data looks like

Code: Select all

["SH005456030000", "SH023383620000", "SH005812410000", "SH010360370000", "SH001945440000"]
and what the server give me back

Code: Select all

The remote server returned an error: (400) Bad Request.
any clue as to what I'm doing wrong. All of the other calls are using the same webclient code with the exception of the "deflate,gzip" header and I've tried the programs request with and without it. nothing I change seems to make any difference at all.