If anyone’s interested in helping to test, I’m going to start opening up a test of v2 of our API on the obs detail page. You can test any observation page by appending test=apiv2 to the url, e.g. https://www.inaturalist.org/observations/71283655?test=apiv2, and curators will soon see a banner at the bottom of the page with an option to make the preference for v2 stick (and to opt-out).
In theory there should be no change in functionality, but in practice there are probably still some bugs.
If you’re curious, API v2 will shift from a static response schema to one that’s more customizable, which should hopefully allow us to save everyone on bandwidth by reducing API response sizes, as well as deal with a lot of stability issues in the mobile apps, especially on older devices with limited memory.
POST https://api.inaturalist.org/v2/observations?taxon_id=7428&order_by=votes&preferred_place_id=&locale=en&ttl=-1&fields=&photos=true¬_id=f1e8af8d-75ee-422d-a00f-a4bc77e3a1ce&per_page=6&details=all 400 (Bad Request)
three errors on each page, which i think corresponds to the bottom sections of the page (more from, nearby, of relatives), which don’t load. example errors:
api.inaturalist.org/v2/observations?user_id=779571&order_by=id&per_page=6&details=all&preferred_place_id=&locale=en&ttl=-1&fields=&order=desc&id_below=70525256:1 Failed to load resource: the server responded with a status of 400 (Bad Request)
api.inaturalist.org/v2/observations?lat=29.7688631&lng=-95.4484492&verifiable=true&radius=50&order_by=observed_on&preferred_place_id=&locale=en&ttl=-1&fields=&photos=true¬_id=f1e8af8d-75ee-422d-a00f-a4bc77e3a1ce&per_page=6&details=all:1 Failed to load resource: the server responded with a status of 400 (Bad Request)
api.inaturalist.org/v2/observations?taxon_id=7428&order_by=votes&preferred_place_id=&locale=en&ttl=-1&fields=&photos=true¬_id=f1e8af8d-75ee-422d-a00f-a4bc77e3a1ce&per_page=6&details=all:1 Failed to load resource: the server responded with a status of 400 (Bad Request)
computer vision suggestions seem to work, but they seem to lack nearby information and new nearby functionality.
taxon autocomplete in suggest ID doesn’t work. example errors:
POST https://api.inaturalist.org/v2/taxa/autocomplete?q=tes&per_page=6&locale=en&preferred_place_id=&fields= 400 (Bad Request)
Uncaught (in promise) Error: Bad Request at thenText (observations-show-webpack-[number].js:131)
taxon autocomplete also doesn’t work on a taxon-based observation field, with similar errors as above.
the previous / next observation buttons don’t work (though maybe that’s intentional in the new design?)
the Android / iOS app indicator logos don’t show up under the observation copyright
selecting / deselecting the reviewed checkbox doesn’t work. example error:
api.inaturalist.org/v2/observations/6cccbffe-34dd-4dc5-a11d-f43daa109420/review:1 Failed to load resource: the server responded with a status of 404 (Not Found)
join project doesn’t work. example error:
api.inaturalist.org/v2/projects/544/join:1 Failed to load resource: the server responded with a status of 404 (Not Found)
adding observation field (yes/no type) didn’t work. example error:
POST https://api.inaturalist.org/v2/observation_field_values 404 (Not Found)
can’t delete final tag on observation. (add 2 tags to an observation without tags. delete one of them. then try to delete the remaining one.) no console errors.
editing an existing taxon-based observation field shows the numeric id of the taxon, not the name of the taxon. (could be related to the taxon autocomplete not working on taxon-based observation fields.) there’s also no x button to remove the taxon id, though since it’s just a number, i can backspace through it.
deleting existing observation field (taxon-based) doesn’t work. example error:
the endemic / threatened indicators for taxa in the observation header and in the community taxon box don’t appear in v2 in some cases (not sure why the difference).
see example below where it doesn’t appear, with v1 to left and v2 to right:
v2 seems to be ignoring some user preferences. in the example below (v1 to the left, v2 to the right), note that the user has limited both project and observation field additions by the community, but there’s no indication of that on the v2 screen, and v2 still has a box to add observation fields:
Trusted users framework appears to be broken, I am no longer seeing the observation actual locations of users who have listed me as a trusted user. Seeing it as an obscured location including the buffer box.
Confirmed by switching back to V1 that I am still trusted and under that version I see the actual location.
in case it helps, several of the bugs i reported earlier seem to be related to my having no preferred place set up (for taxon common names). although i went back and checked only a few things i reported earlier, adding a preferred place in my account settings seems to make at least the following problems go away:
if you still are consistently seeing the error, it might be useful to open up your browser’s developer tools to see if the error messages recorded in the console tell you exactly which request is failing.
since i was looking at this, i noticed another bug. the page shows common name (scientific name) even if you select to display only scientific name. there’s not a problem if you choose common name (scientific name) or if you choose scientific name (common name).
I was not able to mark “No, it’s as good as it can be” on the Community ID quality boxes during the API v2 version. I switched out of testing and it worked as normal. During the API v2 test, it would seem to roll a loading bar and then just stop. Nothing on the observation was changed even after refreshing, just to check.