Issue 171 May Have Been Prematurely Closed
Issue No. 178
Issue 171 reports a forbidden error when attempting to use the api. It is dated July 7.
Something changed around July 6 with the API. My code worked fine until on July 5 but on July 6 started to return a forbidden error when attempting to retrieve this link: <a href="/mlb/standings.json">/mlb/standings.json</a>
The link works fine in a standard browser (my perl code uses Mechanize.)
Looking at my code, I can see that I have been using neither a custom browser string nor an api token. The code I am using is based on code I started using over a year ago, and I haven't changed it all since April.
I would try using an api token, but if I was sent one a year ago, I don't know how to retrieve it. I can, of course, modify the browser id if that's an issue.
Please follow the user agent guidelines listed at <a href="/api#ua">/api#ua</a>
Generic user agent strings such as PHP/5.3, Java/1.5, python-requests, Mozilla/5.0, etc. are... forbidden.
A more helpful error handler has been added on the backend to aid in troubleshooting problems and errors. See <a href="/api/objects/xmlstats-error">/api/objects/xmlstats-error</a>. Check out the Java example <a href="/api/examples#examplehttpclient">/api/examples#examplehttpclient</a> to see how this is used in practice.
Everyone is encouraged to check the HTTP status code for "200 OK" and proceed normally, or for 4xx or 5xx status codes, consume the HTTP response body as an Xmlstats Error object.