Set Captivity Field In API When Creating Observations

I am using the API to create observations, but I cannot find an easy way to set the captivity field.
I have checked both the old and new API.

The new API seems restrictive in the model fields allowed on creation, and the old one is missing this field.

You can add a quality metric vote for captivity, but I we are only identifying street trees and know this is a captive species.

I can also see this captivity field when getting the observation from the new API.

For the old API, we can update observation_field_id’s, but I do not see an easy way to find this ID.

If this is an issue better suited for github, I am happy to raise an issue and a potential PR depending on the community opinion.

Hi, I’m not familiar with creating observations via the API, but this sounds like it might be what you are looking for. Checking the captive/cultivated box when making an observation on the app or website will populate the data quality metric for “wild?” with a no/thumbs down vote.

would you clarify the statements in your original post? i don’t think you can set the captive field directly. i think it changes when you add the wild quality metric. are you having problems setting that quality metric to your desired value?

Hey,

Thank you for the replies.

To clarify, if you go to the bulk edit page, or to the single edit, you have an option to choose “Was it captive / cultivated?” You can click this to set the property to true. Checking the API, I can see a field when retrieving an observation called “Captive” and it is set to true or false. We are using iNaturalist to submit street trees through an app, so I want to submit these trees with this set to true. I don’t know if setting this value directly on the observation is the same as voting that it is captive.

I will try setting the quality metric this week and I will reply back with the results. Thank you for the help.

1 Like

i’m not sure how the captive flag evolved throughout the history of iNaturalist, but right now, if you check the flag in the observation edit page (which is rather old), it effectively sets the wild quality metric to false. so although i didn’t look at the flow of everything under the hood, it looks to me based on the current UI and v1 API that setting the wild quality metric is the correct way to make your desired change.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.