Minor Bug Reports with API

Since I’m going pretty heavily through the iNat API right now, I figured I’d start a thread for the minor issues and discrepencies I’ve noticed:

  1. When user doesn’t provide authentication for some requests, server returns HTTP 500 - Internal Server Error instead of 401 - Unauthorized
  2. POST /observations/{id}/unreview returns a 404, even on the API docs page — is this supposed to be a DELETE operation instead?
  3. DELETE /observations/{id}/unfave returns the Observation whereas most DELETE operations return nothing — just an inconsistency I noticed.

That’s all for now, I’ll add more if I see anything else. Very minor stuff, thanks for making such a thoroughly-documented API!

  1. POST /subscriptions/observation/{id}/subscribe always returns true whether the user is now subscribed or not; this should probably instead return the current subscription status if this API call is still current.
  2. GET /observations/{id}/subscriptions is confusing, if it’s still current. As far as I can tell from testing, it returns some various info about the observation queried if you’re NOT subscribed, and returns nothing if you are subscribed.

Related to #3, there may be a few other DELETE operations which return something, and some which return nothing. Unvoting an Observation is another DELETE operation which returns a value, whereas most don’t.

  1. GET /taxa doesn’t list page as an available parameter, but the server accepts it. I think there was another call with a similar issue but I forgot to note which one.

i can’t reproduce #5. seems to work just fine for me. sometimes indexing isn’t triggered when an observation is updated. so i wonder if that could be related to whatever you’re noticing?

Possibly related to my simple testing then, I only tested this with one example.

  1. GET /identifications/ uses taxon_active as a parameter while GET /observations/ uses taxon_is_active for the same parameter (inconsistent).