import oauth2 as oauth
site = "https://www.inaturalist.org"
access_token_url = "https://www.inaturalist.org/oauth/token"
consumer_key = 'removed for security'
consumer_secret = 'removed for security'
oauth_verifier = 'removed for security'
params = {
'client_id': consumer_key,
'client_secret': consumer_secret,
'code': oauth_verifier,
'redirect_uri': 'http://www.example.com/',
'grant_type': 'authorization_code'}
consumer = oauth.Consumer(consumer_key, consumer_secret)
client = oauth.Client(consumer)
resp, content = client.request(access_token_url, "POST", body=str(paramsXML))
print resp
print content
Hi,
It's still in an early stage of development, but pyinaturalist (https://pyinaturalist.readthedocs.io/en/latest/?badge=latest) can be used to easily upload observations from Python to iNaturalist. See "For authenticated API calls, you first need to obtain a token for the user:" and "Create a new observation" from the link above.
Don't hesitate to ask if you encounter any issue or need a better example (I'm the developer).
Cheers,
Nico
--
You received this message because you are subscribed to the Google Groups "iNaturalist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inaturalist...@googlegroups.com.
To post to this group, send email to inatu...@googlegroups.com.
Visit this group at https://groups.google.com/group/inaturalist.
Two questions about pyinaturalist