Our app worked fine with Version 1 and Version 2 of the Regulations.gov API, but I can't get it to work with version 3. I am using a new API key, and pasting the complete URL in the browser brings back good data. However, when used in our program it returns a "(406) Not Acceptable" error. I also used my new API key in the "Try it now" section on this site, and it also returns an error. It doesn't seem to make sense when pasting the URL in the browser seems to work fine.
-
1I think it will be easier to diagnose your problem with some links, error codes, screenshots, ...– philshemJun 19, 2014 at 20:00
-
There's a lot that gets sent to a web server besides what's in the URL. I've outright denied a User-Agent string before, so no requests were acceptable from them. It's possible to reject for a wide variety of reasons. But more than likely, you missed encoding something. (I once had someone give me a password that had a '#' in it ... and their software didn't URI encode it before passing it)– JoeJun 20, 2014 at 17:40
-
I should also ask -- does the new API key work with the old versions, or the old key worth with the new one? (or did they force you to change, because they're incompatible?). First rule of debugging - minimize the changes ... try to change the API key, or the version, but not both at once.– JoeJun 20, 2014 at 17:46
1 Answer
Use a network sniffer like Wireshark to compare:
- The request that fails
- The request that succeeds
There is probably a tiny difference in the request, that you can find out and fix.
Network sniffers are easier to use on HTTP, but if you are forced to use HTTPS, there are still various solutions.