404 responses to PUT requests to /observation_field_values/{id}

I’m using the Python requests module and API v1, following https://api.inaturalist.org/v1/docs/.

POST to /observation_field_values works correctly
PUT to /observations/{id} works correctly
But PUT to/observation_field_values/{id} doesn’t update the field, and responds with a 404 error, specifically “{“error”:{“original”:{“error”:“Not found”}},“status”:404}”

With this code, the first two requests work and the third doesn’t. I could be missing something but not sure what.

Thank you!

Does it work if you PUT to the UUID (https://api.inaturalist.org/v1/observation_field_values/dfcd6555-6988-43af-9763-0813d65d70b9) instead of the id?

Looks like you’re sending an observation ID and not an observation field value ID. Observations can have multiple observation field values, and each have their own ID which are distinct from their respective observation ID

You’re right, that’s it, thank you!! I really appreciate it, I might never have figured out what the doc meant by “id” here.

Does this mean there’s no single-request way for the API to update/remove a certain field (e.g. “Fungus Substrate/Host”) from a certain observation - we first have to GET the observation, find the ID of that field on this observation, and then PUT/DELETE a request to update/remove it?

Yes, you must use the ID of the observation field value itself to send a request to modify or delete it.

1 Like